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

MVVM Bind calls getter multiple times

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 7.0.2, 7.0.3
    • Fix Version/s: None
    • Component/s: Databind 2
    • Labels:
    • Environment:

      Windows 7, Eclipse Kepler, Chrome, Mozilla

      Description

      I have noticed that a getter in my view model is called multiple times causing me real trouble as this getter executes database transactions. The reason for this is that the control (in my case a selectbox) has been declared inside a Grid to make a nice form layout:

      <row>Type
      <selectbox model="@load(vm.questionnaires)">
      <template name="model" var="q" >
      <label value="@load(q.name)" />
      </template>
      </selectbox>
      </row>

      In this case the getQuestionnaires() is called four times.
      If i declare the <selectbox> outside the grid then it is called only once.

        Attachments

        1. a.zul
          0.2 kB
        2. b.zul
          0.6 kB
        3. SelectboxVM.java
          0.5 kB

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            cyiannoulis cyiannoulis
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: