You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John <jo...@quivinco.com> on 2012/12/13 01:50:59 UTC

clearing form fields when the user navigates away after loading values

I have a form that uses @Persist page fields. If the user navigates away from the page and then returns, the form i sof course still filled in because all the form fields are in the session.

The required behaviour is for the pages persisted fields to be cleared whenever a user navigates to a page page. Obviously I don't want to lose the form values prior to the submit, so FLASH is no good and nor is clearing persisted fields during onActivate.

So what do I do?

John

Re: clearing form fields when the user navigates away after loading values

Posted by Muhammad Gelbana <m....@gmail.com>.
http://tapestry.apache.org/persistent-page-data.html#PersistentPageData-ClearingPersistentFields

> The method *discardPersistentFieldChanges()* of *ComponentResources* will
> discard all persistent fields for the page, regardless of which strategy is
> used to store the property. This will not affect the page in memory, but
> takes effect for subsequent requests.


On Thu, Dec 13, 2012 at 2:50 AM, John <jo...@quivinco.com> wrote:

> I have a form that uses @Persist page fields. If the user navigates away
> from the page and then returns, the form i sof course still filled in
> because all the form fields are in the session.
>
> The required behaviour is for the pages persisted fields to be cleared
> whenever a user navigates to a page page. Obviously I don't want to lose
> the form values prior to the submit, so FLASH is no good and nor is
> clearing persisted fields during onActivate.
>
> So what do I do?
>
> John