UI States [examples]

To cause all UI components to revert back to their default attributes (no UI state set), use:

showdocument("resetstate")
Lianja.showDocument("resetstate")

The ‘Show Orders’ button changes the UI State to ‘state1’.

?changestate:state1

and the ‘Hide Orders’ button changes the UI state to ‘state2’.

?changestate:state2

https://www.lianja.com/doc/index.php/UI_States


 

UI State

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:

Lianja.showDocument(“changestate:namelist”)
or
Lianja.showDocument(“page: page1?action=changestate&state=namelist”)
or
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.