Revision history [back]

click to hide/show revision 1
initial version

answered 2008-11-20 05:01:32 +0800

robertpic71 gravatar image robertpic71

But.. this doesn't work for follow szenario. I have a Listbox with records of customers and on the end of each line there is a button for calling the customers dialog with the selected cutomer record. In that case i cannot give the buttons an id because they are created dynamically for each customers record. How do create you Listbox? forEach, model + Render, pure Java, @databinding

However the fowardutil is pretty smart and handels templates from forEach and @databinding. I.e. the following code works:

<rows id="tableGridRows">
            <row self="@{each=entry}">
                <intbox value="@{entry.mfifir}" cols="2" maxlength="2" format="##" tooltip="help"/>
                <label value="@{entry.mfifirkbez}" tooltip="help"/>
                <image id="trash" src="images/trash empty_24.png" hover="images/trash full_24.png"/>

in my Javaclass (could be ext. Window or Composer)
public void onClick$trash(Event event) { // handels onClick from trashicon

The Databinding use the zul-defintion as template and "clone" this for alle entries.

However if you fill your listbox without zul-definition in java it should work with button.addForward i.e. button.addForward("onClick", win, "onClickTrash");

Note: onClick = Event win = Namespaceowner / Rootcomponent --> Targetcomponent who handels the event (use=java.class or apply=composer.class) onClickTrash = TargetEvent -> methodname from the eventcatcher

public void onClickTrash(Event event) { // handels onClick from trashbutton

Don't use the $ in you manuals Eventhandlers.

Testet with a normal button (i have no lists without databinding here).


Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More