-
10 Feb 2012 6:14 PM #1
TextButton Event Handling how do i do it? What are the ways
TextButton Event Handling how do i do it? What are the ways
Hi,
I have old 2.5 code which i am migrating to 3.0. I would like to fire an event on TextButton click.
This is what i am trying. i am getting error "fireEvent" not defined . Probably because i dont extend Widget class. But, what are the other cleaner options to fire events on Text Button fr 3.0
TextButton button1 = new TextButton ("abc");
button1.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
fireEvent(new ABCControlEvent(ABCControlOperation.RESTART));
}
});
-
13 Feb 2012 3:27 AM #2
If I am not mistaken, you need a class in your application defining its event bus:
Then you fire your event using this event bus:Code:public static EventBus EVENT_BUS = GWT.create(SimpleEventBus.class);
Code:App.EVENT_BUS.fireEvent( ... );


Reply With Quote