-
Bug
-
Resolution: Fixed
-
Normal
-
6.0.0, Freshly
-
None
@NotifyChange with indirect property does not work!
IndirectNotifyChange.java
public class IndirectNotifyChangeVM {
private List<Person> _persons;
public IndirectNotifyChangeVM() {
_persons = new ListModelList<Person>();
for(int j = 0; j < 4; ++j)
}
public List<Person> getPersons()
{ return _persons; } @Command @NotifyChange("persons[0]")
public void chang1stPerson()
@Command @NotifyChange("persons[0].firstName")
public void change1stPersonFirstName()
}
indirect-notify-change.zul
<window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('test.IndirectNotifyChangeVM')">
NotifyChange via indirect [] on a List.
Press "change first name of the first person", the first name of the first person shall change to "Tom".
Press "change first person", the first person shall change to "Henri Chen".
<grid width="500px" model="@bind(vm.persons)">
<columns>
<column label="First Name"></column>
<column label="Last Name"></column>
<column label="Full Name"></column>
</columns>
<template name="model" var="p">
<row>
<textbox value="@bind(p.firstName)"/>
<textbox value="@bind(p.lastName)"/>
<label value="@bind(p.fullName)"/>
</row>
</template>
</grid>
<button label="change first name of the first person" onClick="@command('change1stPersonFirstName')" />
<button label="change first person" onClick="@command('chang1stPerson')" />
<button label="Dump" onClick="binder.getTracker().dump()"/>
</window>