Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Apr 2010
    Location
    San Francisco
    Posts
    16

    Example of using a MessageListener with sendMessage

    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.

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hello,

    unfortunately there is nothing ready at the moment.
    Do you have specific problems?

  3. #3
    Member
    Join Date
    Apr 2010
    Location
    San Francisco
    Posts
    16
    Just need to see an example of the syntax for creating/passing the MessageListener to the sendMessage method of the Lightstreamer engine object.

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    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

  5. #5
    Member
    Join Date
    Apr 2010
    Location
    San Francisco
    Posts
    16
    Thanks - that's exactly what I needed.

 

 

Similar Threads

  1. sendMessage in .net
    By michaelvb in forum Adapter SDKs
    Replies: 2
    Last Post: May 21st, 2008, 02:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 06:33 PM.