Results 1 to 10 of 10

Hybrid View

  1. #1
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33

    how to send a LS server message to a javascript function like a json parameter

    hi all,
    now i'm working with javascript code, i reed the Web Client Dev and i see the jsdoc.
    i can't find a way to send the message from my javaadapter to a javascript function.

    i created my java adapter, this create a String with a json, something like this
    String sMessage = "{field1:'value1',field2:'value2',....}";

    how can i do to pass this String to a javascript function?? and then, how can i run this javascript function with this parameter?? depending of the values i have to hide or show some areas of my web site.

    thanks for your help.

  2. #2
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    well, i try to create a NonVisualTable with a group and schema and the subscription mode is COMMAND, when i try to run this an alert show me with this message

    1: 18:18:46,590 ER addTable Key position is not set correctly for a COMMAND mode subscription. Please specify a field that represents the Key
    when i change the mode to MERGE this work fine.

    i'm not sure about the subscription mode operation, i read the document General Concepts, and not finish to understand, can you explain me??

    about the obtain the message with a java script function, it's done
    the problem is how to conver my string to json.
    is there a way to pass a json parameter instead a string??

    regards

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Unfortunately, no facility is provided for manipulating json data on the client side;
    the update event handler of your NonVisualTable should use the received string and directly use eval or any more sophisticated technique available.

    About subscription modes, they allow for managing a sequence of updates in different ways.
    The name of COMMAND mode may be misleading;
    anyway, it is not aimed at pushing javascript code, but rather at pushing list contents and their changes (through list manipulation "commands").
    At this stage, you can concentrate on MERGE mode and ignore other subscription modes.

  4. #4
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    thanks for your help, i work with MERGE mode.
    i try to work with a string, the problem is i need to pass a lot of data and analyze this information and analyze this information. i see the way to do this.

    regards.

  5. #5
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    hi again,

    i have a new and strange error

    well, I managed to create an application in the following path
    www.mydomain.com/myapp/lsAlarms.php --> master push-page
    everything works in this environment

    i try to change this index.php to
    eco.mydomain.com/myapp/lsAlarms.php

    when i try to run this second a javascript alert show me this message

    1: 18:38:21,223 ER bind Unable to find the Engine. Retrying. If the problem persists, please check your configuration.
    i don't now why this happends :S the code is the same. i only change www.mydomain.com to eco.mydomain.com

    do you have any idea why this happends??

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Please paste here the code you use to configure your PushPage instance.

 

 

Similar Threads

  1. Don't send message when refresh the browser
    By naitsir in forum Client APIs
    Replies: 7
    Last Post: October 2nd, 2012, 11:36 AM
  2. How to send message to each client?
    By hungtt in forum Adapter APIs
    Replies: 7
    Last Post: December 30th, 2010, 04:42 AM
  3. Replies: 6
    Last Post: December 7th, 2010, 10:26 AM
  4. Replies: 1
    Last Post: January 18th, 2010, 04:27 PM
  5. How to send params from client to server
    By kanibal210 in forum Client APIs
    Replies: 1
    Last Post: September 30th, 2009, 09:36 AM

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 04:55 PM.