-
Bug
-
Resolution: Fixed
-
Major
-
8.6.1, 8.6.0.1
-
None
-
Security Level: Jimmy
-
None
-
ZK 8.6.2 S2
-
None
Steps to Reproduce
1. run the attached zul
a listbox with select mold
2. select "Item 2"
Simplified Step
<zk> <zscript><![CDATA[ public class TestVM { List list = Arrays.asList(new String[] {"Group", "Item 1", "Item 2", "Item 3", "Item 4"}); String selected = "Item 1"; public List getList() { return list; } public String getSelected() { return selected; } public void setSelected(String selected) { this.selected = selected; } } TestVM viewModel = new TestVM(); ]]></zscript> <div viewModel="@id('vm') @init(viewModel)"> <listbox mold="select" rows="1" model="@init(vm.list)" selectedItem="@bind(vm.selected)"> <template name="model" > <listgroup if="${each eq 'Group'}" label="${each}" /> <listitem unless="${each eq 'Group'}" label="${each}"/> </template> </listbox> Selected Item: <label value="@load(vm.selected)" /> </div> </zk>
http://zkfiddle.org/sample/1i46ano/3-ZK-4295-simplified
Current Result
- the selected item doesn't change
- zk au doesn't fire
Expected Result
the selected item changes
Debug Information
1. if you select another item at the first time, it works as expected
2. if you select "Item 2" after the second time. For example, select "Item 3" first, then "Item 2", it works as expected.
3. if I remove <listgroup>, this issue doesn't happen.
4. <zk switch> also produces the bug
Workaround
replace <listgroup> with <listitem disabled="true"/>