I suspect the advice about restricting the use of onActivate for
activation context purposes came from
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/onactivateandonpassivate/3

On Thu, Mar 22, 2012 at 1:08 PM, Thiago H. de Paula Figueiredo
<thiag...@gmail.com> wrote:
> On Thu, 22 Mar 2012 12:02:11 -0300, Stephan Windmüller
> <stephan.windmuel...@tu-dortmund.de> wrote:
>
>> For me the advantage of this is the strict separation of code:
>> onActivate handles the activation parameters, setupRender initializes
>> all data which is needed to display the page and onPrepare handles data
>> for form display/submission.
>
>
> This is not strictly correct and your problem is an example of that.
>
>
>> Furthermore (if I remember correctly) the justification was that
>> onActivate is also called when rendering a page link, but I never tested
>> if this is true.
>
>
> This isn't correct. onPassivate() is. onActivate() is invoked when handling
> a page render or an event request.
>
>
>>> For example,  if I'm using a Grid, I usually don't fetch the data for
>>> it in onActivate() or setupRender(), but in a property which is
>>> passed directly to the source  parameter.
>>
>>
>> We have many cases where the get-method would be called multiple times
>> because we need the value during the whole setupRender process. In this
>> case we would need to cache the value in the get-method or something
>> like this. That is why we preferred the initialization at the top of
>> setupRender().
>
>
> Take a look at the @Cached annotation.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

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

Reply via email to