You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by OG...@ersus.com on 2005/06/11 22:37:24 UTC

Programmatically adding a component to a page at runtim

I would like to be able to add (switch out) components to a page during
runtime. I have seen a few examples on the web, however, they fall short in
binding persistent properties of the newly added component. After examining
the PageLoader class, it looks like most of the methods are private or
protected and don't allow one to mimick its operation programmatically. Is
there anyone out there who has successfully added a component during runtime
to a page and gotten the persistent properties to work? This seems to me
like a very important feature missing from the framework, unless I am
totally missing it.

 

Thanks,

Ozzie Gurkan

Integrated Systems Manager

Emerson Retail Services

Tel: 678-631-1925

e-mail: ogurkan@ersus.com

 


Re: Programmatically adding a component to a page at runtim

Posted by Ron Piterman <mp...@vollbio.de>.
There were a few threads about this. You should not do this, because 
pages should be static. According to Howard, this might work in a 
developing enviourenment. On Production you will get problems, because 
of how Tapestry Caches pages.

There are two alternatives. Either use conditional rendering 
(@Conditional) or delegate the rendering to a java class: instead of 
adding a component, your component calls a render method on an custom 
class, passing the writer...

Cheers,
Ron


����� OGurkan@ersus.com:
> I would like to be able to add (switch out) components to a page during
> runtime. I have seen a few examples on the web, however, they fall short in
> binding persistent properties of the newly added component. After examining
> the PageLoader class, it looks like most of the methods are private or
> protected and don't allow one to mimick its operation programmatically. Is
> there anyone out there who has successfully added a component during runtime
> to a page and gotten the persistent properties to work? This seems to me
> like a very important feature missing from the framework, unless I am
> totally missing it.
> 
>  
> 
> Thanks,
> 
> Ozzie Gurkan
> 
> Integrated Systems Manager
> 
> Emerson Retail Services
> 
> Tel: 678-631-1925
> 
> e-mail: ogurkan@ersus.com
> 
>  
> 
> 


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