Yes... but you don't need to use dynamically added components to
accomplish that.
You can accomplish it using a static structure, including direct links.
Or, your "tree" component implements the "IDirect" interface. Then it
generates the urls
needed, and provides the necessary listener and gets called-back
automatically by the
direct service. I think there are some pretty good reasons to keep the
component tree static.
For one thing, page objects are very expensive to create, which
necessitates (the oft maligned)
page pooling. However, because you are pooling the pages, the component
tree MUST be static,
because you can't guarantee that the same page instance will be used the
/next/ time the page is
rendered. There may be ways around that, but generally, I've found that
anything you might think
of solving by using dynamic components can be solved as well or better
by some other method which
tapestry /does/ provide.
(That said, I won't deny wishing for being able to add components at
runtime on occasion. :)
Robert
Tapestry wrote:
It's been a while since I played around with tapestry, but I came to a
point where I wanted components to be dynamically generated.
Take this as example: You create a email-frontend, and want to display
the possible folders in a tree structure. The folder structure is a
priori different for each user, i.e. it is dynamic.
It is evident, that those folders are represented by a DirectLink,
which displays the respective messages.
I am sure that there is a possibility to do this today (I got it
running somehow, but don't ask me how). But the Tapestry spirit tells
me, that there should be a component (the tree structure), which
manages to generate the DirectLinks on the fly.
Does this make sense?
Cheers
cs.
Mark Stang schrieb:
Can you be more specific about how you want to "instantiating
components directly". I am just trying to understand the
definition. Do you want to "draw" a page on the fly? Taking
components and re-arranging them on the page or on a new page? Or
creating components that don't exist at the start of the server but
they do later?
thanks,
Mark
-----Original Message-----
From: Jorge Quiroga [mailto:[EMAIL PROTECTED]
Sent: Thu 1/12/2006 9:58 AM
To: Tapestry users
Subject: Re: instantiating components directly
This issue about dynamic component generation should be considered
seriously for the next major release, because is very necessary and
asked by the community, after all, if almost all are components it
should be possible (if ASP.NET and others can, why not tapestry?).
I'm newbie with T4, and that T4 cannot do it has been very annoying
and for some cases (specially when navigation is defined by state) I
have to choose the less simpler path, and the most simple is one of
the claimed policies in Tapestry, of course T4 isn`t a web panacea,
but this is a really community need.
Thanks.
JQ
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]