Revision history [back]

click to hide/show revision 1
initial version

answered 2008-11-13 13:42:04 +0800

ziccardi gravatar image ziccardi

In your example the data fields have a fixed id. I have not problem with this and the render works ok.

In my example the ids are not fixed. I don't even care about the ids, 'couse I let ZK generate them. I simply associate the rendered object to the attribute "VALUE" of the button (you can add how many attributes as you want. Each button has its own set of attributes). Than, in the event listener, I ask for the button that generated the event and I get the attribute value back..

In your example, I would do something like this:

In the renderer

b.setAttribute("TCOMPONENT", t); b.setAttribute("IBCOMPONENT", ib);

In your event listener:

new EventListener() 
{
     public void onEvent(Event evt) 
     {
           Button btn = (Button) evt.getTarget();
           Textbox t = (Textbox)btn.getAttribute("T_COMPONENT"));
           Intbox ib = (Intbox)btn.getAttribute("IB_COMPONENT"));

           ib.setReadonly(false);
           // ...
     }
}
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More