In fact, BeanEditForm and Grid suffer from the same problem, and a fix will
be forthcoming.

Basically, there will be a configuration point for contributing page names,
and matching them up to (in BeanEditForm/Grid) various property types.

The same pattern can hold; define new pages, contribute a LibraryMapping
into the configuration for ComponentClassResolver service, contribute
whatever into a service you write to vend out the correct Blocks.

On 5/24/07, Ivan Dubrov <[EMAIL PROTECTED]> wrote:

Howard Lewis Ship wrote:
> This is very easy in Tapestry; just put the components on another page,
> inject the page, and choose the component from that page.
And how to deal with actionlink's inside the component/block from
another page? All actions will go to the page the component/block
belongs to, not to the page that rendered the component/block.

Of course, I could place all required components on first page inside a
block, as described earlier, but in this case to add a new fruit type
(for example, "orange") I have to modify Page1 template. And I want the
ability to add new view type ("lemon", "grapefruit") by adding
additional .jar inside my application.

Currently it looks like the following: I have several pages like
ViewLemon, ViewGrapeFruit with required blocks inside them and page
ViewFruit. The ViewFruit page determines the fruit type, requests the
certain page from the RequestPageCache service (although it's internal,
so it is not good idea to use it), retrieves block from the page and
renders it. I could add new fruit types dynamically (by adding
additional .jar file to WEB-INF/lib with new fruit type and View<fruit
type> page). It works OK, besides the actionlink's inside the block. Do
you have any idea how can I deal with this situation? I need the ability
to add new "fruit types" (application plugins) without modification of
page templates.
>
> This same approach is what drives BeanEditForm and Grid: the ability to
> choose components or blocks to render at any particular time.
>


--
WBR,
Ivan S. Dubrov






--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

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

Reply via email to