[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Restore the grid's state explicitly  XML
Forum Index -> Development
Author Message
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

I am using the "Saving and Restoring a Grid's Runtime State" explained in the developer's guide. It is a fantastic feature, like all in CaptainCasa.

I would like to implement the following use case:
1. The grid is rendered according to the info stored (with own persistence) in a previous session.
2. The user updates (rearranges, resizes or sorts) the grid without implicitly or explicitly storing (storepersistentDataImplicitly is overrriden)
3. The user wants to undo these updates in the current session

For step 3, I was looking in FIXGRIDBinding for a method in addition to storePersistentData like e.g. restorePersistentData or undoUserUpdate.

What is the best way to program step 3?

With kind regards, Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Hi,

I believe you should be able to do this the following way:

Override the initialize() method of the FIXGRID. THis is only called once during a FIXGRIDBinding's life cycle.

Keep the column/sort/etc. data in the grid (i.e. in your class deriving from e.g. FIXGRIDListBinding). Now you have the "base" to get back to later on if the user want to undo all changes during using the grid.

Please make sure that you code initialize the following way:
Code:
 public void initialize()
 {
     super.initialize();
     ...
     ... you
     ...
 }
 


Regards, Björn

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

Just to thank you for your advice. It works perfect.

Regards, Daniel
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team