Skip to main content

JSF 2.0.3 and composite attributes "required" validation

3 replies [Last post]
nzinoviev
Offline
Joined: 2008-06-11

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

then

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.

Also in cases such as

if I use the component with a panelGroup guard

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.

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.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ryan Lubke

Hello,

On 1/27/10 9:06 AM, webtier@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
>
> then
>
> 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
>
>
> if I use the component with a panelGroup guard
>
>
>
>
>
> 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@sun.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=383309
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

edburns
Offline
Joined: 2004-02-11

I have reopened 1472. I think you have exposed a case I missed when I fixed 1472. Thanks for reporting it, and thanks to Ryan for bringing it to my attention.

Ed

nzinoviev
Offline
Joined: 2008-06-11

Thank you guys. Unfortunately I haven't recieved any notifications about your replies (how's that??!).
Special thanks to Ed, I would be very doubtful about adding my whole post to the issue.
I'd like to know what behavior you would consider to be right. Probably you might just add the description to the issue.