When I use children binding in MVVM, i get this exception
org.zkoss.zk.ui.UiException: Callable only in the event listener
at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:334)
at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:348)
[...]
when in my zk.xml I use :
<disable-event-thread>false</disable-event-thread>
example :
toto.zul
<zk> <window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('toto.VMToto')"> <vlayout children="@load(vm.listStrings)"> <template name="children" var="myString"> <label value="@bind(myString)"/> </template> </vlayout> </window> </zk>
VMToto.java
public class VMToto { List<String> listStrings = new ArrayList<String>(); @Init public void init() { listStrings.add("Alpha"); listStrings.add("BĂȘta"); listStrings.add("Gamma"); } public List<String> getListStrings() { return listStrings; } public void setListStrings(List<String> listStrings) { this.listStrings = listStrings; } }
Please, look at this discussion for more information and a (not really elegant work around)
Thank you very much. I'm a big fan totally devoted of ZK
Sam.