Having problems getting a javascript callback to work...
Below is my attempt at creating a link who's onclick method calls a
java method. I set a break point on displaySomeInfo but it never gets
called.
Does anyone know what I'm doing wrong?
Thank you,
Scott
VerticalPanel panel;
public void onModuleLoad() {
createCallback();
panel = new VerticalPanel();
panel.add(new HTML("<A href=\"#\" onclick=\"callback('ziggy
dog');return false;\">Click here.</A>"));
RootPanel.get().add(panel);
}
private void displaySomeInfo(String aStringToDisplay) {
panel.insert(new HTML(aStringToDisplay), 0);
}
private static native void createCallback()
/*-{
var that = this;
$wnd.callback = $entry(function()
{ that.@com.compoz.earth.client.Earth::displaySomeInfo(Ljava/lang/
String;); });
}-*/;
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home