public class NewRegAuthAlert extends FlowPanel {
public NewRegAuthAlert() {
String html = "For addmin comments please <div id=\"login2\">sign
in</div> or register";
add(new HTML(html));
}
protected void onLoad() {
Label.wrap(DOM.getElementById("login2")).addClickHandler(new
ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
Window.alert("alert message");
}
});
}
}
In dev mode this doesn't work.
java.lang.AssertionError: A widget that has an existing parent widget may not
be added to the detach list
at
com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose(RootPanel.java:136)
at com.google.gwt.user.client.ui.Label.wrap(Label.java:130)
But when compiled works fine. Please help.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/cS0RlZtO6fIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.