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.


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