Revision history [back]

click to hide/show revision 1
initial version

answered 2010-03-03 11:41:55 +0800

robertpic71 gravatar image robertpic71

[CORRECTION for the Java source] // autowired event public void onClick$deleteButton(MouseEvent event) { Component comp = (Component) event.getTarget(); // use Component or Button Wsis deleteThis = (Wsis) comp.getAttribute("wsi"); // delete the object } [/CORRECTION]

About your question:

I read the thread and I don't understand where does come from the 'event' param in the onClick attribute :

Like a Desktop-UI like Swing, every click and/or change (could) fire an event. You have to catch the event. The event knows this source and target. Your listbox contains items and deletebutton's. You can get the "clicked" button with event.getTarget(). This returns the Component (in your case button). Because you have assigned a custom-attribute to each button you can get the corresponding object.

There are still other ways to catch events, but with databinding you have to use this way.

/Robert

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