I am using wrtkit 1.0 framework for a wrt application. My application has two ListView objects, one that lists categories and one that lists details. User selects a category to view its details. When I go back from the details ListView to the category ListView I want the selected category to be visually highlighted, ie have focus.
It seems that wrtkit always highlights the first control in the ListView not the one with focus.
I have tried the following code to give highlight style to the focused control but wrtkit only gives focus highlight to the first control in the list.
uiManager.setView(categoryView); // show the category view
var btns = categoryView.getControls(); // get the list of controls in the view
// selectedCategory is a number representing the control that was selected
// give focus to the control with selectedCategory as its index
var focusedControl = categoryView.getFocusedControl(); // get the index of the focused control
alert(focusedControl.id); // display this index in the alert box to test
WRTkit correctly identifies the control with focus but does not seem to change the style of the control to show that it has focus and instead defaults to the first control being highlighted. This is a confusing behavior and is not intuitive for applications. Returning to the category view should show the previously selected category with the highlight, not the first one.
Is this a bug? or is there another way for wrtkit to change highlight to the focused control instead of always showing highlight on the first control. How can I get wrtkit to show highlight style for the control with focus in a ListView?