State management

As told on the core feature list at the beginning, it is possible to maintain the dynaWidget grid´s state over multiple requests.

What makes the dynaWidget grid´s state?

The grid´s state is made up of the properties from all widgets in the grid. If you had a look in the  examples section  you´re already familiar with some default widget properties, e.g. title, position, commandEdit, ...

When does the state change?

On the first load of a dynaWidget grid the so called initialState is taken as the grid state. Afterwards each dynamic modification of the grid (move widget, collapse/expand widget, add/remove widget, change a widget´s property, ...) will update the grid´s state depending on the state management strategy.

State management strategies

There are four options for managing the grid´s state: The State state management strategy to be used can be configured on the dynaWidget grid component:
			<dwComp:dynaWidgetGrid id="myFirstGrid" columns="2" 
			    defaultStateStore="server|cookie"
				stateStore="#{myOwnStateStoreImplementationBean}"			    
				templateBaseUrl="widgetContent" width="500"
				initialState="{...}" />
      	
What´s important here:

Implement you own state store

You can implement your own state store by implementing the WidgetStateStore interface. For using your implementation just set it to the stateStore attribute of the dynaWidget grid.