Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1999

Children Binding not working with event-thread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.5.4
    • Databind, Databind 2
    • Any kind, I guess, with <disable-event-thread>false</disable-event-thread> in zk.xml

      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)

      http://forum.zkoss.org/question/89396/children-binding-uiexception-callable-only-in-the-event-listener/

      Thank you very much. I'm a big fan totally devoted of ZK

      Sam.

            Unassigned Unassigned
            samroy samroy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: