In asp.net, there is a control called a LinkButton. It looks like a link but behaves like a button. Is there a similar control is gxt, or a way to reproduce it.
I'd like to have some code like this
Code:
LinkButton logout = new LinkButton("Logout");
logout.addListener(Events.OnClick, new Listener<ComponentEvent>() {
@Override
public void handleEvent(ComponentEvent be) {
...
}
});
I've tried with LabelField and Text, but I can seem to make either of them aware of when the user clicks on the link.
My code so far is
Code:
Text logout = new Text("Logout");
logout.setTagName("span");
logout.setStyleAttribute("cursor","pointer");
logout.addListener(Events.OnClick, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
Info.display("click", "moo");
}
});
RootPanel.get().add(logout);