To store states in a database, you must provide a specific provider to the StateManager (The default provider is CookieProvider). The best way is to create a RpcStateProvider.
Create a new class which implements Provider abstract class. Then create a new instance of this class and then set it to the StateManager:
The difficulty : RpcStateProvider is by definition asynchronous (RPC call). When your application or GXT call
the result is supposed to be the value of your state. With RpcStateProvider the result is always null. So you have to provide a asynchronous callback which is responsible of setting the value to the correct widget.
I've done such provider and a PreferenceManager window which is able to save user interface preferences (typically a grid preference : column visibility, grouping, column order, ...) to a XML file on the server side. Currently I have to refactor my code to separate our specific code.