incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "magdolna holitska" <mholits...@hotmail.com>
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=""
                            value="#{myBean.myObject.myProperty.myId}"
                            contentStyle="width:10em">
            <f:selectItems value="#{myBean.myProperties}"/>
        </tr:selectOneChoice>

If myBean.myObject.myProperty is null, I get an error in the UI:
        javax.servlet.ServletException
        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=""
                            value="#{myBean.myObject.myProperty.myId}"
                            contentStyle="width:10em">
            <f:selectItems value="#{myBean.myProperties}"/>
        </h:selectOneMenu>

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

Thank you,
Magdolna






>From: "magdolna holitska" <mholitska3@hotmail.com>
>Reply-To: adffaces-user@incubator.apache.org
>To: adffaces-user@incubator.apache.org
>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(FacesServlet.java:202)
>
>What would be the best way to get around it?
>Thanks again,
>
>Regards,
>Magdolna
>
>
>
>
>>From: "Adam Winer" <awiner@gmail.com>
>>Reply-To: adffaces-user@incubator.apache.org
>>To: adffaces-user@incubator.apache.org
>>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 <mholitska3@hotmail.com> 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, 
>>>it
>>>has the appearance of an output text.
>>>Any hints?
>>>
>>>Thank you,
>>>Magdolna
>>>
>>>
>>>Here is a simple example:
>>><tr:selectOneChoice id="ex" label="Example" value="#{true ? 'L1' : 
>>>'L2'}">
>>>         <tr:selectItem label="L1" value="L1"/>
>>>         <tr:selectItem label="L2" value="L2"/>
>>>         <tr:selectItem label="L3" value="L3"/>
>>></tr:selectOneChoice>
>>>
>>>_________________________________________________________________
>>>Buy what you want when you want it on Sympatico / MSN Shopping
>>>http://shopping.sympatico.msn.ca/content/shp/?ctId=2,ptnrid=176,ptnrdata=081805
>>>
>>>
>
>_________________________________________________________________
>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. 
>http://www.youthographyinsiders.com/R.aspx?a=116
>

_________________________________________________________________
Donít waste time standing in lineótry shopping online. Visit Sympatico / MSN 
Shopping today! http://shopping.sympatico.msn.ca


Mime
View raw message