Results 1 to 7 of 7

Thread: Cursor Adaptor best practices

  1. #1

    Cursor Adaptor best practices

    Hi,

    I have a scenario where I am using two virtualtables.
    One is a straight select, the other I created using a where clause that references the first.

    I did this to mimic a parent - child relationship.

    Create virtualTable v_customers....select * from customers
    Create virtualTable v_locations....select * from locations where custid = {v_customers.custid}

    I make sure to use v_customers first, then use v_locations.

    My question - if in fact this is not a poor design on my part - where do I set up the cursor adaptor for v_locations?
    Do I do it in the init of the app or load of the page?
    I seem to be doing something wrong as sometimes the cursoradaptor works and sometimes it does not.

    Whats the best way to accomplish this?


    Thanks.

    Herb

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

    When an App is loaded this is the order of events in pseudocode.

    Code:
    app::init()
    foreach page
        page::init()
        set all page attributes
        foreach section
            section::init()
            set all section attributes
            foreach FormItem (fields and gadgets):
                formitem::init()
                set all formitem attributes
             endfor
        endfor
    endfor
    then when the app is fully loaded and all UI elements are in the LOM (Lianja Object Model) hierarchy.

    Code:
    app::load()
    foreach page
        page::load()
        foreach section
            section::load()
            foreach FormItem (fields and gadgets):
                formitem::load()
            endfor
        endfor
    endfor
    So app:init() would be the place to open your tables.
    Last edited by barrymavin; 2013-07-16 at 23:57.
    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
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,184
    Hi Barry,

    that's very helpful information.

    After the init() and load() processes are complete, and the app is ready to run, it would be very helpful to have a event that could then set up the app for first use. Is there a delegate available for that purpose?

    thanks,

    Hank

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    No but it would not be difficult to add. Such as? afterLoad() ?
    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
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    BTW there is a new MVP build in the normal place.
    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

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    And.. Lianja SQL Server for Linux distro is ready to ship with RC7.
    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

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    Quote Originally Posted by HankFay View Post
    Hi Barry,

    that's very helpful information.

    After the init() and load() processes are complete, and the app is ready to run, it would be very helpful to have a event that could then set up the app for first use. Is there a delegate available for that purpose?

    thanks,

    Hank
    In RC7 I have now added a "Ready" delegate for App, Pages, and Sections.

    This is called after the "Load" delegate when the LOM is ready. So the complete order of events is:

    Code:
    app::init()
    foreach page
        page::init()
        foreach section
            section::init()
            foreach FormItem (fields and gadgets):
                formitem::init()
            endfor
        endfor
    endfor
    Code:
    app::load()
    foreach page
        page::load()
        foreach section
            section::load()
            foreach FormItem (fields and gadgets):
                formitem::load()
            endfor
        endfor
    endfor
    Code:
    app::ready()
    foreach page
        page::ready()
        foreach section
            section::ready()
            foreach FormItem (fields and gadgets):
                formitem::ready()
            endfor
        endfor
    endfor
    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

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