I agree with you gaz; I'd *like* to be able to do things that way
myself. It's more natural for my programming background since its similar to
the way most gui frameworks I've worked with operate e.g. you want a new
button? You add a new button :). You don't have to declaratively thing ahead
at design time to the conditions under which the button ought to appear.
Not being a Tapestry Committer, I can't speak with absolute
authority here, but my limited experience with the Tapestry code base is
that the dynamism you and I would like to see is close to antithetical to
the existing architecture. In other words, I think this is one of those
things we're both just going to have to do the 'tapestry way' and not try to
make tapestry into, say, swing.
--- Pat
> -----Original Message-----
> From: gaz jones [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 12, 2006 1:14 PM
> To: Tapestry users
> Subject: Re: instantiating components directly
>
> what i meant by "instantiate components directly" is something like:
>
> DirectLink directLink = new DirectLink();
> directLink.setListener(onClickThisLink);
> this.getComponents.add(directLink);
>
> or something along those lines...
>
> i realise you can use
>
> <span jwcid="@If" condition="whatever">
> put something in here...
> </span>
>
> but that doesnt really give you the same flexibility as being able to
> add them in code in say an abstractcomponent renderComponent method...
>
> it was merely a query anyway. i personally do think it would be a nice
> thing to have... but being unable to do it has yet to cause me any
> problems in tapestry...
>
>
> On 1/12/06, Robert Zeigler <[EMAIL PROTECTED]> wrote:
> > 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: tapestry-user-
> [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]
> >
> >
>
> ---------------------------------------------------------------------
> 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]