Hm... are you sure you aren't env.pop'ing that PageId somewhere else? It really 
ought to still be available in environment in AfterRender.  Thiago is correct 
that you don't /have/ to pop it since the service is per-thread, but it's 
disturbing to me that it's not there in AfterRender... unless one of your 
SubPage classes is "pop" ing it instead of "peek" ing it?

Robert

On Aug 23, 2010, at 8/2311:50 AM , Thiago H. de Paula Figueiredo wrote:

> On Mon, 23 Aug 2010 13:38:14 -0300, Rich M <rich...@moremagic.com> wrote:
> 
>> I'm assuming you mean in the Containing Page?
> 
> Yes.
> 
>> I tried switching it to onActivate instead of beginRender and in this case 
>> the afterRender method throws a NoSuchElementException when trying to pop 
>> the Object from the Environment, code as below:
>> 
>> //@BeginRender
>>     public void onActivate(){
>>         debug("Loaded ViewProductTab and SubPageId = " + this.id);
>>         env.push(PageId.class, id);
>>     }
>> 
>>     @AfterRender
>>     public void  popPageId(){
>>         this.id = env.pop(PageId.class);
>>     }
> 
> I guess you don't need to pop the object, as Environment is a per-thread 
> service. And marking a method as handling two different events is not safe in 
> Tapestry AFAIK.
> 
> -- 
> 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