incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "magdolna holitska" <>
Subject Re: Drop down list issue when using EL
Date Tue, 16 Jan 2007 21:43:13 GMT
Hi again,

Here is a little example for the problem I have.

        <tr:selectOneChoice id="tr" unselectedLabel=""
            <f:selectItems value="#{myBean.myProperties}"/>

If myBean.myObject.myProperty is null, I get an error in the UI:
        Target Unreachable, 'myProperty ' returned null

If I am replacing the Trinidad drop down list with regular JSF component,
"#{myBean.myObject.myProperty.myId}" resolves to null without a problem:

        <h:selectOneMenu id="h" label="Normal Status" unselectedLabel=""
            <f:selectItems value="#{myBean.myProperties}"/>

Any idea why tr:selectOneChoice creates an exception instead of resolving 
the value to null?
Is there a nice workaround?

Thank you,

>From: "magdolna holitska" <>
>Subject: Re: Drop down list issue when using EL
>Date: Wed, 10 Jan 2007 11:52:05 -0500
>Hi Adam,
>Thanks a lot for the reply.
>The reason I tried that is to actually do a check for null value.
>In my code I have something like:
>	value="#{a.b.c}"
>As I understood from the EL documentation - if a.b is null, a.b.c should 
>automatically resolve to null.
>However in my code, if a.b is null it fails with the error:
>	javax.servlet.ServletException:
>	...
>	Target Unreachable, 'b' returned null
>	javax.faces.webapp.FacesServlet.service(
>What would be the best way to get around it?
>Thanks again,
>>From: "Adam Winer" <>
>>Subject: Re: Drop down list issue when using EL
>>Date: Tue, 9 Jan 2007 16:19:20 -0800
>>A value expression like #{true ? ... : ...} is not writable -
>>if you call ValueBinding.isReadOnly(), it returns true.
>>As a result, Trinidad automatically turns the
>>selectOneChoice to readOnly mode.
>>For a writable EL expression, you have to just point
>>at a bean property.
>>-- Adam
>>On 1/9/07, magdolna holitska <> wrote:
>>>Hi all,
>>>I have a drop down list and I am trying to set the value selectively.
>>>Whenever I use EL in the code, the drop down list disappears and instead, 
>>>has the appearance of an output text.
>>>Any hints?
>>>Thank you,
>>>Here is a simple example:
>>><tr:selectOneChoice id="ex" label="Example" value="#{true ? 'L1' : 
>>>         <tr:selectItem label="L1" value="L1"/>
>>>         <tr:selectItem label="L2" value="L2"/>
>>>         <tr:selectItem label="L3" value="L3"/>
>>>Buy what you want when you want it on Sympatico / MSN Shopping
>Your opinion matters. Please tell us what you think and be entered into a 
>draw for a grand prize of $500 or one of 20 $50 cash prizes. 

Donít waste time standing in lineótry shopping online. Visit Sympatico / MSN 
Shopping today!

View raw message