-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
6.0.0, 6.0.1
-
None
For example, given a zul page with a listbox and a button:
<button label="Init" forward="mainWin.onInitList" />
<listbox id="exampleList" mold="select" rows="1"></listbox>
The event-handler onInitList is as follows:
public void onInitList()
{
Listbox example_list = (Listbox) getFellow("exampleList");
example_list.getItems().clear();
for (int i = 0; i < 7; i++)
example_list.setSelectedIndex(6); // select last item
}
When user clicks on the button, then the listbox will be filled with 7 items and the last item will be selected.
So far everything is okay. However, if user now manually selects another list item (e.g. "Item 2") and then presses the button again, then suddenly no list item is selected (although the last item should be selected again).
A workaround is to call example_list.invalidate() after example_list.setSelectedIndex(6).