Hi everybody

I see that the instance field that holds the current page number of a grid 
(org.apache.tapestry5.corelib.components.Grid.currentPage) is annotated with 
@Persist .

This has the probably desirable effect that f.ex. if I am on webpage A and it 
has a grid and I browse to its page #2 and then I go to another webpage and 
then I go back to webpage A its grid is still on its page #2 where I had left 
it.

However in my case this is not desirable and I would prefer that the grid page 
number is not remembered across different webpages.

Removing the @Persist annotation of Grid.currentPage instance field altogether 
would cause the impossibility to browse grid pages at all because the grid 
pager does a page reload and this loses the currentPage value, but persisting 
that value just until the next request - to preserve that value during the page 
reload  - seems to work fine: I changed the annotation from

@Persist

to

@Persist(PersistenceConstants.FLASH)

and I'm testing my pages to make sure this works. However I am also wondering 
if in theory changing that persistency to flash might be a bad idea for reasons 
that I don't know and that my tests so far are not showing. Does anyone have 
any opinion about this ?

Reply via email to