Applet Callback not working..

25 views
Skip to first unread message

Nim

unread,
Sep 20, 2009, 4:03:51 AM9/20/09
to gwtai
Hi,
i m using GWT 1.5.3 ver.So far playing with GWT-Applet is
great,but i need to have Applet Callback working.I have compare my
code with Demo application,i found no mistake in my code.

1) Registration:
final CounterApplet counterApplet = (CounterApplet) GWT
.create(CounterApplet.class);
Widget widgetApplet = AppletJSUtil.createAppletWidget
(counterApplet);
AppletJSUtil.registerAppletCallback(counterApplet,
new TestCallback(panelMain));

2)Callback implementation:

public class TestCallback implements AppletCallback<String>{
private VerticalPanel _panelLaps;
private int _lap;

public TestCallback(VerticalPanel panelLaps) {
_panelLaps = panelLaps;
_lap = 1;
}

public void callback(String msg) {
_panelLaps.add(new HTML("<b>Lap " + _lap + "</b> : " +
msg + " seconds"));
_lap++;
}
}

3)
AppletUtil.callback(CounterAppletImpl.this,"Recorded");

Kindly share some thoughts on it.
Thanks in Advance.
Reply all
Reply to author
Forward
0 new messages