-
25 May 2012 4:06 PM #1
Unanswered: Ui handling TextButtons addClickHandlers
Unanswered: Ui handling TextButtons addClickHandlers
Can someone explain how to handle buttons in forms that are created through UiBinding?
For example, I have created the UIBinding Form demo, but the buttons do nothing, so from that perspective the demo is useless.
In other examples, I see the TextButton being handled by:
@UiHandler("buttonName")
void onClick(ClickEvent e) {
Window.alert("Hi");
}
But when I try to use the above as a guide to make a button do something really useful I keep getting this error:
Field 'buttonName' does not have an 'addClickHandler' method associated.
Try as I might I am unable to create an addClickHandler that the TextButton will recognize, so can someone please explain how to do this?
Thanks in Advance.
Cheers.
-
30 May 2012 3:06 PM #2
Try this instead:
GXT uses the SelectEvent instead of a ClickEvent to make sure that all possible ways the user might activate the button will work correctly, including tabbing into the button and using the space or enter key. A ClickEvent wouldn't be appropriate there, as there would be no way to report a X,Y position for the click, so instead we abstract out possible selection behavior into the SelectEvent.Code:@UiHandler("buttonName") void onClick(SelectEvent e) { Window.alert("Hi"); }


Reply With Quote