title: zk - is it possible to add binding to each record in model?
body: <pre><code>&lt;zk&gt;
      &lt;grid width="auto" sizedByContent="true" span="1" sclass="tblWithoutHover"&gt;
          &lt;attribute name="onCreate"&gt;
              authorPublisherEtcInclude.insertBefore(self, authorBox);
          &lt;/attribute&gt;
          &lt;columns&gt;
              &lt;column/&gt;
              &lt;column/&gt;
          &lt;/columns&gt;
          &lt;rows&gt;
              &lt;row valign="center"&gt;
                  &lt;cell colspan="2"&gt;&lt;label use="${authorPublisherComponents.originalFieldsLabel}"/&gt;&lt;/cell&gt;
              &lt;/row&gt;
              &lt;row valign="center"&gt;
                  &lt;label use="${authorPublisherComponents.titleAuthorOriginalLabel}"/&gt;
                  &lt;textbox use="${authorPublisherComponents.titleAuthorOriginalTextbox}"/&gt;
              &lt;/row&gt;
              &lt;row valign="center"&gt;
                  &lt;label use="${authorPublisherComponents.mainAuthorOriginalLabel}"/&gt;
                  &lt;textbox use="${authorPublisherComponents.mainAuthorOriginalTextbox}"/&gt;
              &lt;/row&gt;
              &lt;row valign="center"&gt;
                  &lt;label use="${authorPublisherComponents.mainAuthorResponsibilityLabel}"/&gt;
                  &lt;selectbox use="${authorPublisherComponents.mainAuthorResponsibilitySelectbox}"/&gt;
              &lt;/row&gt;
              &lt;row valign="center"&gt;
                  &lt;label use="${authorPublisherComponents.authorityDatesOriginalLabel}"/&gt;
                  &lt;textbox use="${authorPublisherComponents.authorityDatesOriginalTextbox}"/&gt;
              &lt;/row&gt;
              &lt;row valign="center"&gt;
                  &lt;cell&gt;
                      &lt;label use="${authorPublisherComponents.addMainAuthorsOriginalLabel}"/&gt;
                      &lt;toolbarbutton use="${authorPublisherComponents.addAuthorButton}"/&gt;
                  &lt;/cell&gt;
                  &lt;cell id="addAuthorsCell"&gt;
                      &lt;grid id="addAuthorsContainer" model="@bind(ivm.inventory.addAuthorsBeans)"&gt;
                          &lt;columns&gt;
                              &lt;column/&gt;
                              &lt;column/&gt;
                              &lt;column/&gt;
                          &lt;/columns&gt;
                          &lt;rows&gt;
                                  &lt;row&gt;
                                      &lt;textbox value="@load(xgbfxb.authorName)" onChange="@command('test', component = self, index=s.index)"/&gt;
                                      &lt;button label="Del" onClick="@command('delAuthor', container=addAuthorsContainer, index=modelIndex )"&gt;
                                          &lt;custom-attributes modelIndex="${s.index}"/&gt;
                                      &lt;/button&gt;
                                  &lt;/row&gt;
                          &lt;/rows&gt;
                      &lt;/grid&gt;
                      &lt;textbox use="${authorPublisherComponents.addMainAuthorsOriginalTextbox}"/&gt;
                  &lt;/cell&gt;
              &lt;/row&gt;
  </code></pre>
  
  <p>Here is part of my zul page. addAuthorsBeans is list of classes with fields. When I change data in my combobox, application call set method for all classes in list, but I want it to call only for corresponding item. Is it possible? Or should I cast black magic with onChange events and ViewModel methods?</p>
  
  <p>Edit (21/12/2013). It works like this: I have got three items 1, 2, 3. Then I activate setAuthor for 2 item. And then application call setAuthor method for 2 item, then for 3 item, then for 1 item and then looking for this method in container. </p>
  
  <p>I have 'black magic' temporary solution to create static variable and change it on first call of setAuthor method and unblock it in container.</p>
  
  <p>But it's not a final solution, because it's consume more resources and really not how should it really works.</p>
  
  <p><strong>Solution:</strong> if you've got grid with model in another grid it will behaive very strange. So just use listbox instead.</p>