you CANT add a PageLink component to your page using java in a component
inheriting from AbstractComponent. that is the problem (or one of them)...
its the 2nd issue that is the real stinker though...

On 1/26/06, Ron Piterman <[EMAIL PROTECTED]> wrote:
>
> Maybe I am too long in Tapestry develpement, but I really can't see the
> problem here.
>
> If you want to link to a page, you add a PageLink component to your
> page, done.
>
> If you want the page name the link references to be dynamic, you make
> the page parameter binding of the PageLink component read its value from
> a property in your page's / component's class using ognl. done.
>
> So what is really the probelm?
>
> Cheers,
> Ron
>
>
> gaz jones wrote:
> > hi,
> >
> > i have already posted a question about this regarding dynamic insertion
> of
> > content into the page, but i thought i would bring it up again because i
> > think not being able to do so violates the DRY principle (O_o).
> > for example, if i have a component inheriting from AbstractComponent and
> i
> > want to put a page link in the page, i have to (if i understand it
> > correctly):
> >
> > add a reference to the engine service in the component:
> >
> > @InjectObject("engine-service:page")
> > public abstract IEngineService getPageService();
> >
> > then in renderComponent...
> >
> > writer.begin("a");
> > ILink link = getPageService().getLink(true, "MyGreatPage");
> > writer.attribute("href", link.getURL());
> > writer.print("Go to my great page");
> > writer.end("a");
> >
> > when what i SHOULD be able to do, if tapestry were truly a component
> based
> > framework is:
> >
> > in renderComponent...
> >
> > PageLink pageLink = new PageLink();
> > pageLink.page = "MyGreatPage";
> > getPage.addComonent(pageLink); // or something similar
> >
> > otherwise i am repeating the effort of the original PageLink author am i
> > not? there may be a better way to do this that i dont know about though
> > obviously...
> >
> > not creating a proper hierarchy of components is also causing other
> > problems, such as processing components when in loops. you cant get at
> > specific instances of components in the rewind cycle because they all
> share
> > the same pooled component - is that correct?
> >
> > do the authors of the framework have any comments on these points above
> or
> > any indication if this will change in the future? you can do both of
> these
> > things in other component based web frameworks, and i would see it as a
> > benefit if you could also do so in tapestry. does anyone else agree?
> >
> > cheers
> > gaz
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to