Results 1 to 3 of 3

Thread: Access individual canvas fields' attributes in non-desktop apps?

  1. #1
    Junior Member
    Join Date
    Jul 2015
    Posts
    25

    Access individual canvas fields' attributes in non-desktop apps?

    Hi everyone,

    I'm using canvases a lot in my app for the added flexibility they bring. In a desktop app, you can access (for example) the text in field1 of a canvas with
    Code:
    var myvar = Lianja.get("page1.section1.field1").text
    In non-desktop apps this seems to fail. I've tried running that both client- and server-side to the same result. Running in the JavaScript console in the web app debugger
    Code:
    Lianja.get("page1.section1.field1").text
    returns "".

    This makes me think the feature isn't implemented in non-desktop apps? If not, is there a different way of doing it? I find this functionality really useful in a lot of ways, for example setting the default value of a textbox dynamically based on what the user entered on a previous page.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    In JavaScript web and mobile apps they have a JavaScript object variable declared automatically as the ID of the UI control so naming is important.

    in your case here you would name field2 something sensible and just reference the properties as field2.property.

    Also look at the toJSON() method on sections if you want to gather all data off a form to send to a server side procedure for processing. Use this in conjunction with base64_encode() and base64_decode() on the server.
    Last edited by barrymavin; 2016-02-08 at 18:14.
    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
    Junior Member
    Join Date
    Jul 2015
    Posts
    25
    Oh okay that's a lot faster. Thanks Barry!

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