Rich Faces State API allows easily define some set of states for the pages and any properties sets for this states.

Imagine one state as a set of named value bindings method bindings and some additional properties to be used after the state activated. So you could define inputs values, controls labels and actions, rendering conditions and etc using the same state variables which will have different values for every state.

Next small example panel has two states: login and register. Lets list the changes between login and register.

- Confirmation field for password should appears in register state.
- Method bindings should differs for the action button in every state.
- Value bindings for the fields could be different between states.
- Some labels should be changed between states

Also there should be a link which will switch states from login to register

Now try the example itself before further explanations.

Title

Actually states is a map where the entry key is name of the state and value is state map. Concrete state map has entries with some names as keys and any objects as values. So any value or method bindings or just simple state constants could be saved in State map.

Rich Faces state API implements states change as standard JSF navigation. Action component should just return outcome and our extension for JSF navigation handler will check if this outcome registered as state change outcome. If such state change outcome found - corresponding state will be activated and in other case - it will call standard navigation handling

There is step by step instructions how configure Rich Faces states manager for existing JSF application in details tab.