Results 1 to 10 of 10

Thread: Section default state

  1. #1

    Section default state

    Hi,

    If I would like to have a section set to be collapsed at start of the application, is there a way I can specify that in the app:init?

    Thanks.

    Herb

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

    "Collapsed" or "Hidden"?

    Use the new "Ready" delegate to perform operations on the LOM after the App is loaded.

    oSection = Lianja.get("section1")
    oSection.collapse()

    or

    oSection.hide()

    There are also counterparts for these:

    oSection.expand()

    or

    oSection.show()

    Typically these are used in the UI state rules.
    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 Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Hi Herb,

    When I looked at the code for this I thought it should be available in an inline delegate too so I just added it.

    section1?action=collapse
    section1?action=expand
    section1?action=hide
    section1?action=show

    Which can also be accomplished with:

    Lianja.showDocument("section1?action=collapse")
    Lianja.showDocument("section1?action=expand")
    Lianja.showDocument("section1?action=hide")
    Lianja.showDocument("section1?action=show")

    I prefer inline delegates or using Lianja.showDocument() as this way it is scripting language independent and in fact inline delegates are NoCode. Bear in mind you can chain inline delegates together with ||

    section1?action=collapse||section2?action=expand

    Which can be put to good use when building workflow apps as you change state in the app dependent on use input.
    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

  4. #4
    Cool - thanks Barry.

  5. #5
    Hmmm...

    I can get the collapse to work in the app inspector and in a button click event.
    But - it's ignoring me in the ready, load and init events.

    Thanks -
    Herb

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    You can't reference the LOM in init() and load() as it not ready. You can only reference it in the "ready" delegate -- which is seems is called before the sections are given their state (collapsed/expanded/etc). I will look into that.
    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,183
    Blog Entries
    22
    Quote Originally Posted by hmischel@diligentsystems.com View Post
    Hmmm...

    I can get the collapse to work in the app inspector and in a button click event.
    But - it's ignoring me in the ready, load and init events.

    Thanks -
    Herb
    I have moved the place where "Ready" is called and it is now working in the next build. Previously it was called before the sections were expanded.
    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

  8. #8
    And this is why I love Lianja - Thanks Barry!

  9. #9
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hi Herb,

    Did this solution work for you?
    I've tried Barry's methods although I can't seem to get it to collapse when switching from design mode to runtime mode or by switching pages.

    Cory

  10. #10
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    After some further testing, it does seem to work when the application is freshly loaded.
    This will not work if the application is already open and you change to the runtime mode.

    Cory
    Last edited by CGibson; 2013-09-11 at 15:13.

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