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
Printable View
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
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.
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.
Cool - thanks Barry.
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
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.
And this is why I love Lianja - Thanks Barry!
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
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