[jsr-314-open] required attributes in composite components

Kito Mann kito.mann at VIRTUA.COM
Mon Apr 13 13:41:24 EDT 2009


Excuse me -- minor correction:


The final proposal is that we add an attribute to <composite:interface>:

strict="{true|false}"

When strict is true, any use of an attribute which is not defined via
<composite:attribute> will throw an exception (I'm not sure which exception,
but I expect that others do).

Ed or Roger?


> On 4/3/09, Pete Muir <pmuir at redhat.com> wrote:
>> > Just one :-)
>> >
>> > On 3 Apr 2009, at 17:54, Kito Mann wrote:
>> >
>> >> Are suggesting both of those options or just one?
>> >>
>> >> Sent from my iPhone
>> >>
>> >> http://www.jsfcentral.com
>> >> http://www.Virtua.com
>> >>
>> >>
>> >> On Apr 3, 2009, at 2:50 PM, Pete Muir <pmuir at REDHAT.COM> wrote:
>> >>
>> >>> Yes, I like the idea. I was trying to think about attribute names,
>> >>> as restrictAttributes feels wrong. How about
>> >>>
>> >>> * strict="{true|false}"
>> >>> * complete="{true|false}"
>> >>>
>> >>> On 2 Apr 2009, at 12:56, Kito Mann wrote:
>> >>>
>> >>>> So, here's one other thing that came up at JSFDays -- the fact
>> >>>> that composite components (like Facelet compositions) don't
>> >>>> restrict which attributes can be used. This is fine for Facelet
>> >>>> compositions, but since composite components can define specific
>> >>>> attributes, it makes sense to give component authors the ability
>> >>>> to restrict page authors to those attributes.
>> >>>>
>> >>>> I think the easiest way to handle this from a component author's
>> >>>> perspective would be to add an attribute to the
>> >>>> <component:interface> tag:
>> >>>>
>> >>>> <component:interface restrictAttributes="true">
>> >>>> <component:attribute name="name" required="true"/>
>> >>>> <component:attribute name="size"/>
>> >>>> </component:interface>
>> >>>>
>> >>>> So, in this case, this component would _only_ accept the name and
>> >>>> size attributes, and the runtime would throw an exception if
>> >>>> another attribute were used. An IDE could also complain when
>> >>>> someone tried to use a different attribute.
>> >>>>
>> >>>> Thoughts?
>> >>>> ---
>> >>>> Kito D. Mann -- Author, JavaServer Faces in Action
>> >>>> http://twitter.com/kito99  http://twitter.com/jsfcentral
>> >>>> http://www.virtua.com - JSF/Java EE consulting, training, and
>> >>>> mentoring
>> >>>> http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info
>> >>>> +1 203-404-4848 x3
>> >>>>
>> >>>> Public JSF Course in NYC (April 21st-24th):
>> >>>> http://www.regonline.com/jsf-course
>> >>>>
>> >>>
>> >>> --
>> >>> Pete Muir
>> >>> http://www.seamframework.org
>> >>> http://in.relation.to/Bloggers/Pete
>> >
>> > --
>> > Pete Muir
>> > http://www.seamframework.org
>> > http://in.relation.to/Bloggers/Pete
>> >
>> >
>>
>>
>> --
>>
>> http://www.irian.at
>>
>> Your JSF powerhouse -
>> JSF Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20090413/4fa5240a/attachment.html 


More information about the jsr-314-open-mirror mailing list