ComponentResources includes a method, discardPersistentFieldChanges(), for this purpose ... the trick is to know when to invoke it.
In Tapestry 5.2, there's a new lifecycle method, pageReset(), that your pages/components can implement. It is invoked during page render requests, when the active page changes. See the nightly documentation for details. On Wed, Jan 20, 2010 at 5:50 PM, Hilco Wijbenga <hilco.wijbe...@gmail.com> wrote: > Hi all, > > I have a page (MyPage) with an embedded component (MyComponent). The > component uses @Persist to store a value (@Persist String myValue;). > > This all works (of course). But I noticed that when I jump from > domain.com/index to domain.com/mypage, myValue still has the value > from last time. How do I clear it? > > I tried to use @Inject MyComponent myComponent in MyPage so that I > could clear myValue in the pageDetached method but apparently it's not > possible to inject a component? > > Any advice would be appreciated (also comments about this approach, is > it wrong to @Persist values in a component?). > > Cheers, > Hilco > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org