Flash persistence is good for getting data between the action and
render requests. Tapestry does redirect after every event so you'd
generally set the value in an action request so you can use it in the
render request, or vice versa I suppose.

It took some considering to come up with why you might be seeing your
data live longer than I'd expect. I would have expected it to go to
the DB for the second render. This might be wrong, I don't have time
to write a test case, but here is what I think is happening:

onPrepare (rendering) users == null; fetch users and stores flash property
onDelete(submit) reads flash property (users not null so doesn't do
lookup), removes it from the session
--- Component @Parameter writes through to the property on the page
storing the value back into the session
redirect to render, onPrepare(rendering) reads flash property and
removes it from the session.

If you want a property to last more than a single read then you should
probably use session persistence.

Josh



On Tue, Sep 14, 2010 at 7:50 AM, Stephan Windmüller
<stephan.windmuel...@tu-dortmund.de> wrote:
> On 14.09.2010 15:14, Thiago H. de Paula Figueiredo wrote:
>
>> I think your component shouldn't extend AbstractField.
>
> Okay, but in either case the data is not set correctly.
>
> In the surrounding page I defined the "users" object as a List with
> flash persistence. In the onPrepare method I check if it is null and
> when it is, the users are fetched from the database.
>
> This works only once: On the first rendering of the page all users are
> fetched. Deleting one user within the component works, the users are set
> with flash persistence. But on the next click, either "Delete" or one of
> the surrounding form, all values are null again and fetched from the
> database.
>
> Am I using flash persistence wrong here?
>
> Regards
>  Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to