Could you give me some sample js for using the MessageListener with sendMessage? I can't find any examples in the forum, or the demos.
Thanks.
Printable View
Could you give me some sample js for using the MessageListener with sendMessage? I can't find any examples in the forum, or the demos.
Thanks.
Hello,
unfortunately there is nothing ready at the moment.
Do you have specific problems?
Just need to see an example of the syntax for creating/passing the MessageListener to the sendMessage method of the Lightstreamer engine object.
Hi,
so let's modify the buysell.js file of the PortfolioDemo (source code available in the Lightstreamer distribution).
First of all let's implement the MessageListener interface:
our simple implementation will simply alert us of the result of the request.
Then let's use it in the submitForm method.
First we need a simple counter to identify the messages, so declare a "next" var before the submitForm method:
then create a MyMessageListener instance per each message and pass it to the sendMessage method
Obviously you'll implement the MessageListener interface to fit your needs :)
That's all.
HTH
Thanks - that's exactly what I needed.