webtier@glassfish.java.net

Re: [webtier] JSF 2.0.3 and composite attributes "required" validation

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Tue, 02 Feb 2010 08:36:13 -0800

Hello,

On 1/27/10 9:06 AM, webtier_at_javadesktop.org wrote:
> Hi!
>
> Yesterday we tried switching from JSF 2.0.2 snapshot to 2.0.3.
> We ran into several issues, here's the most unexpected one:
>
> I have declaration<composite:attribute name="headerText" required="false" default="#{cc.attrs.header}" type="String" shortDescription="header text to use, defaults to header name"/>
>
> then
> <h:outputText styleClass="tableHeader" value="#{cc.attrs.headerText}"/>
> renders as
> /resources/components/adjustableColumnHeader.xhtml @21,172 default="#{cc.attrs.header}"
>
> looks like something is broken with expression evaluation.
> Unfortunately I don't have much time-resources to experiment now, but I'd like to raise the issue early.
>
Thanks - please open an issue [1] for this.
> Also in cases such as
> <composite:attribute name="list" required="true" shortDescription="collection to iterate through"/>
>
> if I use the component with a panelGroup guard
>
> <panelGroup rendered="#{not empty MyBean.list}">
> <my:outputResults list="#{MyBean.list}"/>
> </panelGroup>
>
> I still get the exception if the list is null. Probably it's okay because the tree is build despite the values of rendered expression.
> Probably, the only way out is to change code to return Collections.emptyList instead of null. But there are similiar cases where I pass either null or a single object.
>
> If this is an expected behavior that's fine, just would be nice to be sure.
>
This behavior was introduced as part if issue 1472 [2] .
> Of course, obvious meaning of "required" looked like "some expression should be set for it" not "the specified value shouldn't be null". But may be strict variant is okay.
>
I agree. Please re-open 1472 and append this new information to the
issue. I'll be sure it gets reviewed this week.

[1] https://javaserverfaces.dev.java.net
[2] https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1472
> [Message sent by forum member 'nzinoviev' (nikita.zinoviev_at_sun.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=383309
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>