myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aneesha Govil" <popcor...@gmail.com>
Subject Re: Custom date component attributes
Date Fri, 01 Dec 2006 06:44:17 GMT
On 12/1/06, Simon Kitching <simon.kitching@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

Mime
View raw message