PDA

View Full Version : Clickable Text Object



thomhehl
1 Apr 2012, 3:33 PM
I found this link:

http://www.sencha.com/forum/showthread.php?49949-Clickable-Text-object

But it doesn't seem to work under 2.25. How can I set up a click event on a Text object in 2.25?

Thanks.

Jose Jeria
9 Apr 2012, 11:25 PM
The following works fine for me


// retrieve the HTML element with an ID equals to 'settings'
RootPanel link = RootPanel.get("settings");
link.sinkEvents(Event.ONCLICK);
link.addHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("click!");
}
}, ClickEvent.getType());

thomhehl
21 May 2012, 6:09 AM
So, in this example, what's "settings"? Is that the ID of the text component?

Jose Jeria
21 May 2012, 11:41 PM
Yeah, the ID of the HTML element whos onclick event I wanted to handle.