Hi,
I have a small piece of javascript code that I would like to wrap around
with JSNI to make it GWT. It is essentially a javascript that calls
amq.addListener where amq is a object provided by amq.js. When a message
arrived, I would like it to call a Java Callback function.
Here is the Javascript that call the addListener method and then do
something.
amq.uri='/mycontext/amq';
var myHandler =
{
rcvMessage: function(message)
{
alert("received "+message);
}
};
amq.addListener(myId,myDestination,myHandler.rcvMessage);
For the GWT context, I would like the myHandler function to call a Java
callback object that I can define within GWT.
Here is the jsni code, but it does not work. Could someone tell me what's
wrong?
public static native void listen(ActiveMqCallback cb) /*-{
var myHandler =
{
rcvMessage: function(message)
{
Event e = new Event(message);
[EMAIL
PROTECTED]::onEventArrived(Ljava/lang/String,Ljava/lang/String;)(message.type,message.value);
}
};
amq.addListener(myId,myDestination,myHandler.rcvMessage);
}-*/;
Thank you very much in advance for all your help.
Pete
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---