I am actually doing stuff like that inside the component already. The
problem is that my main component is generic, so I can't include it directly
in the template.

i.e. I have:

base component: ManageEntity<T>
child component: ManageApplications extends ManageEntity<Application>

ManageApplications doesn't add anything to the java code, and doesn't
include a template file, but it is necessary in order to use the component.

I had hoped that I would be able to do:

<t:manageEntity beans="applications"  t:id="manager" />

@Component
private ManageEntity<Application> _manager;

But it didn't work, so I had to resort to subclassing. Unfortunately, this
means I can't do:

<t:manageEntity>
<t:parameter name="addBlock">

</t:parameter>
</t:manageEntity>

in my ManageApplications template, since I cannot use <t:manageEntity>. So I
would have to subclass ManageApplications to something like
ManageApplicationsVerbose and then do:

<t:manageApplications beans="applications">
<t:parameter name="addBlock">
....
</t:parameter>
</t:manageApplications>

in order to extend the template.

Thanks for the suggestion, though :-)


Peter Beshai


On Fri, Apr 4, 2008 at 1:53 PM, Josh Canfield <[EMAIL PROTECTED]> wrote:

> No... you can't extend the template file, at least not yet that I've heard
> of.
>
> You may be able to consider instead of extending the component you
> could create a container for it that passes the block as a parameter,
> along with whatever other configuration.
>
> Parent template:
>
> <div>
> <t:defer to="overrideBlock">
> </div>
>
> <t:block id="defaultOverrideBlock">default stuff</t:block>
>
> in the Parent class your getOverrideBlock either returns the parameter
> overrideBlock or the defaultOverrideBlock.
>
> Child template:
>
> <t:parent>
> <t:parameter name="overrideBlock">
> override stuff....
> </t:parameter>
> </t:parent>
>
> Of course, that's not going to be the right solution in all cases...
>
> Josh
>
> On Fri, Apr 4, 2008 at 8:22 AM, Peter Beshai <[EMAIL PROTECTED]>
> wrote:
> > I have a parent component Base and a component Child which extends Base.
> If
> > I want Child to use Base's template, I cannot include a template file
> for
> > Child. However, I am interested in overriding just one block of Base's
> > template with Child and I was wondering if there is anyway to do this.
> >
> > Thanks,
> > Peter Beshai
> >
>
>
>
> --
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to