Results 1 to 6 of 6

Thread: Preffered way to access data in a javascript section for web/mobile

  1. #1

    Preffered way to access data in a javascript section for web/mobile

    Hi,

    This doesn't seem to be working for me.

    Code:
    db = Lianja.openDatabase("southwind");
    rs = db.openRecordSet("example");
    var mytable = Lianja.getCursor("example");
    var lastname = mytable.getData("LAST_NAME");
    Is there a different way I am suppose to use data in a javascript section for web and mobile?

    Thanks.

    Herb
    Last edited by hmischel@diligentsystems.com; 2015-12-11 at 14:31.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    There is a cursor maintained internally for each table bound to a section which you can reference using Lianja.getCursor().

    If you are hand coding data access and not using data binding (which does all this for you) operate on the recordset that is returned from openRecordSet() through its methods.

    You can't mix cursor objects and record set objects. They are two completely different things.
    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
    Jan 2014
    Posts
    351
    Hi Barry

    Do you mean cursors refers to the tables bound to the sections of current page?
    So we should only use Recordset object to get /update data for tables not bound to the page sections?

    Your advice is much appreciated

    Thanks & Best Regards

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Hi Tek Hong,

    Yes.

    However, I would write a server-side business proc if I wanted to hand code CRUD operations for non UI bound data or a multi table transaction such as a debit/credit operation. I would not do this on the client.

    Most modern apps use data binding. If they don't you need to have a good reason for wasting time and effort doing something which is already done for you.
    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

  5. #5
    Hi Barry,

    Data Binding makes a lot of sense.

    I see how to data bind a form section, but I cant seem to find a way to bind a custom section.

    can you please explain how do that?

    Thanks.

    Herb

  6. #6
    My apologies - I think I misunderstood.

    Data binding is on the standard UI sections, not the custom sections - which is fine, I just didn't understand that.

    Herb
    Last edited by hmischel@diligentsystems.com; 2015-12-12 at 23:36.

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