Results 1 to 4 of 4

Thread: Share variable between javascript and rsp

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Location
    São Paulo - Brasil
    Posts
    105

    Share variable between javascript and rsp

    How the best way to share and change a memory variable using javascript and use on RSP?

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,207
    Blog Entries
    22
    Hi Jefferson,

    Can you explain in more detail.

    Are you wanting to update a LianjaScript memory variable in am RSP from javascript running in the browser client?

    You can't. Its client/server.

    You need to pass parameters in with the URL and access them from your rsp using getParameter()
    Last edited by barrymavin; 2022-05-10 at 08:34.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    São Paulo - Brasil
    Posts
    105
    Hi Barry,
    I'm trying to work around the problem in the section calendar with VT OleDb. so the idea is to get the information using Lianja.evaluate() with the delegate refresh and send it to the server.
    I need show this working today.
    I made a test, but work only the first time.

    ///// JavaScript Delegate
    function page1_section1_refresh()
    {
    var cid = Lianja.get("page1.section1.field1");
    var result = Lianja.evaluate("session_var('" + cid.text + "')");
    var result1 = Lianja.evaluate("get_session_var()");
    Lianja.showMessage("cid-r:"+result+"\nsession-r:"+result1);
    };

    //// session_var.prg
    parameters m_var
    if isSet(_SESSION)
    _SESSION.var = m_var
    v_ret = _SESSION.var
    else
    v_ret = m_var
    endif
    list memo to file c:\temp\session_var_memo
    return v_ret

    /// exports.conf
    session_var

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,207
    Blog Entries
    22
    You cannot guarantee the state of the server in a web app. What you are doing is not going to work on a heavily loaded system.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Tags for this Thread

Bookmarks

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
  •  
Journey into the Cloud
Join us