Table of content
With the deprecation of stateful pages we need a way to preserve control state across requests.
Add a new interface that stateful controls can implement:
Some useful utilities include:
Each control will be responsible for storing it's own state as well as it's children. It's up to the control or container how to best store the state, but should keep the following in mind:
- state stored in the session is replicated in a cluster and should be as compact as possible eg: object array instead of a List
- while arrays are compact and has order, child controls can be reordered meaning the wrong state could be applied to a control. In this instance a Map would be a more flexible solution by storing the control state against its name, and structural order doesn't matter, as long as the controls are moved around inside that container only. If a control is moved to another container it won't be possible to restore it's state automatically, however it would still be possible for the developer to find the original state and apply it manually on the changed structure.