You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Peter Mahoney <pm...@digitalbrain.com> on 2005/04/12 17:45:03 UTC

Problem using x:radio with the RI

There seems to be a problem using the x:radio component with the RI. I 
am using a dataTable to list each of the options, one per row. I 
therefore need to use an expression to provide the index attribute. The 
RI resolves the value of the expression to a Long, however HtmlRadio 
casts the value of the expression to an Integer. The RI returns a Long 
value for the expression #{0}. As a fix, I have changed the cast to Number:

        Number v = vb != null ? (Number)vb.getValue(getFacesContext()) : 
null;

Is this a bug with the RI or MyFaces?

Thanks

Peter
 

Re: Problem using x:radio with the RI

Posted by Peter Mahoney <pm...@digitalbrain.com>.
The MyFaces implementation also returns a Long value for #{0}. The JSF 
spec refers to the JSP 2.0 spec which suggests the value could be a Long 
or BigInteger as the result of an integer expression. Therefore this 
suggests that the cast should be to Number in both HtmlRadio and 
HtmlCheckbox. I will raise a bug.

Peter

Sean Schofield wrote:

>Don't know since I haven't tried it with either.  Why don't you try it
>with MyFaces impl to see if it works as you expect?  If it doesn't
>then report it as a bug in JIRA and someone will take a look.  I'd
>also check the spec to see if this isn't the specified behavior.
>
>sean
>
>On Apr 12, 2005 11:45 AM, Peter Mahoney <pm...@digitalbrain.com> wrote:
>  
>
>>There seems to be a problem using the x:radio component with the RI. I
>>am using a dataTable to list each of the options, one per row. I
>>therefore need to use an expression to provide the index attribute. The
>>RI resolves the value of the expression to a Long, however HtmlRadio
>>casts the value of the expression to an Integer. The RI returns a Long
>>value for the expression #{0}. As a fix, I have changed the cast to Number:
>>
>>        Number v = vb != null ? (Number)vb.getValue(getFacesContext()) :
>>null;
>>
>>Is this a bug with the RI or MyFaces?
>>
>>Thanks
>>
>>Peter
>>
>>
>>    
>>


Re: Problem using x:radio with the RI

Posted by Sean Schofield <se...@gmail.com>.
Don't know since I haven't tried it with either.  Why don't you try it
with MyFaces impl to see if it works as you expect?  If it doesn't
then report it as a bug in JIRA and someone will take a look.  I'd
also check the spec to see if this isn't the specified behavior.

sean

On Apr 12, 2005 11:45 AM, Peter Mahoney <pm...@digitalbrain.com> wrote:
> There seems to be a problem using the x:radio component with the RI. I
> am using a dataTable to list each of the options, one per row. I
> therefore need to use an expression to provide the index attribute. The
> RI resolves the value of the expression to a Long, however HtmlRadio
> casts the value of the expression to an Integer. The RI returns a Long
> value for the expression #{0}. As a fix, I have changed the cast to Number:
> 
>         Number v = vb != null ? (Number)vb.getValue(getFacesContext()) :
> null;
> 
> Is this a bug with the RI or MyFaces?
> 
> Thanks
> 
> Peter
> 
>