You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Aneesha Govil <po...@gmail.com> on 2006/12/01 07:44:17 UTC

Re: Custom date component attributes

On 12/1/06, Simon Kitching <si...@rhe.co.nz> wrote:
>
> Aneesha Govil wrote:
> > Hi,
> >
> > I am creating a date component with some additional attributes on top of
> > t:inputdate. Do I need to add only the new attributes to component tag
> > or do I also need to add the attributes already a part of parent
> > HtmlInputDate?
>
> You can subclass the original tag class, which means you do not then
> need to write java code to handle the original properties.
>
> However in the .tld file there is no way to say that a <tag> element
> extends another, so in the .tld file entry you do need to copy-and-paste
> all the attribute definitions from the parent tag. Ecch.
>
> Of course if you can use Facelets instead, all this is much nicer; no
> tag class or .tld file is required at all.
>
> Note also that it is possible to add new properties to a tag, and use
> them in a renderer without writing a new component class at all, as
> every component has an attributes map that can store data, effectively
> "tunnelling" properties from the tag to the renderer. Sometimes this is
> useful, and sometimes it is better to create a new component class.
>
> Regards,
>
> Simon


The custom component is working! :) At least onchange="submit()" is working.
Don't need the rest of the attributes :)

Thanks for your help!

Regards,
Aneesha