You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Britske <gb...@gmail.com> on 2008/09/30 18:18:04 UTC

T5: actionlink calls onActivate twice: detecting first time

as part of onActivate I do some processing: 
- user validation
- parsing of params
- DAO / repository calls etc.

I want to avoid as much of this work as possible obviously. 
When this counts a lot is when actions are used. In that case the flow is
like: 

click --> onActivate --> onAction --> onActivate. (please comment if this is
not as it should be)
ultimately leading to calling the above code twice, while the first-time
(the activate before the onAction) this particular code doesn't need to be
executed (except the validation). 

This caused me to think that perhaps using the onActivate method isn't the
best place to load entities which are used for rendering (and not for page
navigation). 
However, methods like beginRender and setupRender are called twice as well.
Isn't this strange?? I thought setupRender, beginRender as well as any
method called through the page-template would be called in the Render-action
only. (So in this case only after the second onActivate occurs) correct?

So basically what I'm asking is:
- is the observerd behavior correct? or does this sound strange?
- where would be the best plave of isolating information neded to run in the
render-action only? And how would I make sure that indeed it is only run in
the Render-action?

Thanks in advance,
Britske
-- 
View this message in context: http://www.nabble.com/T5%3A-actionlink-calls-onActivate-twice%3A-detecting-first-time-tp19745430p19745430.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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