Lianja States provide you with a powerful mechanism for handling complex business processes using a "State machine" which is built into Lianja.
State machines have many interesting uses. States can easily describe user interfaces but they can also be used to model high-level business processes and many other things.
In a Lianja App, each UI element (App, Pages, Sections and FormItems) contains a (optional) comma separated list of "States" that the UI element responds to. In Lianja 3.2 we have added a new delegate called stateChanged(cState) which is called whenever a UI State is changed. This provides you with a programmable hook for managing App state.
e.g:
Code:
Lianja.showDocument("changestate:namelist")
or
Code:
Lianja.showDocument("page: page1?action=changestate&state=namelist")
or
Code:
Lianja.showDocument("section:section1?action=chang estate&state=namelist")
The delegate is called with one argument, the name of the state. Note that the namelist is a comma separated list so you can trigger multiple UI state changes at once.
When a "resetstate:namelist" is applied to the App the delegate is called with a single argument which is preceeded by a "-" sign e.g. "-editing".
Note that changing UI state is only handled in runtime mode not the development view.




All topics in [Answers] alphabetically: https://www.lianja.com/community/sho...ll=1#post13748

These answers are also systematized on the site "Lianja developer": https://lianjadeveloper.wordpress.co...gory/ui-state/