You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2006/02/06 00:59:14 UTC

Inherit pages components

Hello there, is it possible to inherit some page components? for eg. All my
form pages has this fragment of code:
<component id="errors" type="For">
<binding name="source" value="beans.delegate.fieldTracking"/>
<binding name="value" value="currentFieldTracking"/>
</component>
<component id="error" type="Delegator">
<binding name="delegate" value="currentFieldTracking.errorRenderer"/>
</component>

Thanks Kent for this in your book ;)

Well, I must copy and paste this in every page I have (at least is what I'm
doing now :P). Is it possible to use some kind of inheritance to solve this?
Like having a parent xml file containing this and then extending it?

Regards

Re: Inherit pages components

Posted by Vinicius Carvalho <ja...@gmail.com>.
Doh! I`m using border component and had not even though on that, sorry ;)
On 2/5/06, Jesse Kuhnert <jk...@gmail.com> wrote:
>
> Most people use the Border component pattern for things like this. (the
> tacos demo has an example, so does the Workbench from tapestry)
>
> That's what I would do.
>
> On 2/5/06, Vinicius Carvalho <ja...@gmail.com> wrote:
> >
> > Hello there, is it possible to inherit some page components? for eg. All
> > my
> > form pages has this fragment of code:
> > <component id="errors" type="For">
> > <binding name="source" value="beans.delegate.fieldTracking"/>
> > <binding name="value" value="currentFieldTracking"/>
> > </component>
> > <component id="error" type="Delegator">
> > <binding name="delegate" value="currentFieldTracking.errorRenderer"/>
> > </component>
> >
> > Thanks Kent for this in your book ;)
> >
> > Well, I must copy and paste this in every page I have (at least is what
> > I'm
> > doing now :P). Is it possible to use some kind of inheritance to solve
> > this?
> > Like having a parent xml file containing this and then extending it?
> >
> > Regards
> >
> >
>
>

Re: Inherit pages components

Posted by Jesse Kuhnert <jk...@gmail.com>.
Most people use the Border component pattern for things like this. (the
tacos demo has an example, so does the Workbench from tapestry)

That's what I would do.

On 2/5/06, Vinicius Carvalho <ja...@gmail.com> wrote:
>
> Hello there, is it possible to inherit some page components? for eg. All
> my
> form pages has this fragment of code:
> <component id="errors" type="For">
> <binding name="source" value="beans.delegate.fieldTracking"/>
> <binding name="value" value="currentFieldTracking"/>
> </component>
> <component id="error" type="Delegator">
> <binding name="delegate" value="currentFieldTracking.errorRenderer"/>
> </component>
>
> Thanks Kent for this in your book ;)
>
> Well, I must copy and paste this in every page I have (at least is what
> I'm
> doing now :P). Is it possible to use some kind of inheritance to solve
> this?
> Like having a parent xml file containing this and then extending it?
>
> Regards
>
>