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

ZK Bind and forEach - looks like not a bug

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Invalid
    • Affects Version/s: 6.0.0
    • Fix Version/s: 6.0.0
    • Component/s: Databind 2
    • Labels:
      None

      Description

      Tryed to use forEach and zkbind with no success. It looks like not compatible. I couldn't find any documentation. Maybe it is not possible or should I post it as a feature request? Sorry if I posted it wrong.

      This is my code, it doesn't work:

      <window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('TestVM')">
      <zscript>

      public class Bean {
      String name;
      public String getName()

      { return name; }

      public void setName(String name)

      { this.name = name; }

      }

      public class TestVM {
      public ArrayList list = new ArrayList();
      public List getList()

      { return list; }

      public void setValue(ArrayList list)

      { this.list = list; }

      public TestVM()

      { Bean b1 = new Bean(); Bean b2 = new Bean(); Bean b3 = new Bean(); b1.setName("first"); b2.setName("second"); b3.setName("third"); list.add(b1); list.add(b2); list.add(b3); }

      }
      </zscript>
      <zk forEach="@load(vm.list)">
      <vlayout>
      <label value="@load(each.name)"/>
      </vlayout>
      </zk>
      </window>

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            manuelmoreno manuelmoreno
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: