You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Oliver Lieven <ol...@provantis.de> on 2005/09/05 18:41:31 UTC

Tapestry4: access PageLoader.createImplicitComponent - DynamicBlock

Hi, I'm trying to migrate out Tapestry 3 application to Tapestry 4.
It makes intensive use of M. Henderson's DynamicBlock component (see
http://www.behindthesite.com), which allows loading of components which
are dynamically specified by their name (in our case, the component's name
is specified in a database).

The DynamicBlock component makes use of the
PageLoader.createImplicitComponent() method, which IMHO cannot be accessed
in Tapestry4 any more (since I cannot access the PageLoader)...

What would be the best way to access the
PageLoader.createImplicitComponent() method, i.e. how can I get an
initialized PageLoader instance?

Should I
- create own class and inject PageLoader via hivemind?
- add a getPageLoader() method to PageSource class?
- make _loader member variable protected and subclass pageLoader?
- ???

Or is there another & better way which I haven't encountered yet?

Any help is very welcome!


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


Re: Tapestry4: access PageLoader.createImplicitComponent - DynamicBlock

Posted by Howard Lewis Ship <hl...@gmail.com>.
I looked at some DynaBlock stuff while I was at a client and, from
what I could see, it would not work in a cluster or under heavy load. 
The fact that the Tapestry APIs erroneously make components look
read/write when they are, in fact, read only is a problem to be
corrected.

The problem is that you may affect one page within the page pool and
change its state, and some future request will arrive and use some
OTHER page in the page pool with a different structure. 
StaleLinkException if you are lucky!

In Tapestry 4, there are lots more hooks, related to class
enhancements, for you to change the specification of the component
after its read from the XML (and/or annotations) and before the class
is instantiated, etc.  Use those!

You can easily add your own  code to look at meta data or class or
method annotations to get all kinds of interesting things
accomplished.

On 9/5/05, Oliver Lieven <ol...@provantis.de> wrote:
> Hi, I'm trying to migrate out Tapestry 3 application to Tapestry 4.
> It makes intensive use of M. Henderson's DynamicBlock component (see
> http://www.behindthesite.com), which allows loading of components which
> are dynamically specified by their name (in our case, the component's name
> is specified in a database).
> 
> The DynamicBlock component makes use of the
> PageLoader.createImplicitComponent() method, which IMHO cannot be accessed
> in Tapestry4 any more (since I cannot access the PageLoader)...
> 
> What would be the best way to access the
> PageLoader.createImplicitComponent() method, i.e. how can I get an
> initialized PageLoader instance?
> 
> Should I
> - create own class and inject PageLoader via hivemind?
> - add a getPageLoader() method to PageSource class?
> - make _loader member variable protected and subclass pageLoader?
> - ???
> 
> Or is there another & better way which I haven't encountered yet?
> 
> Any help is very welcome!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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