myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathias Brökelmann <mbroekelm...@googlemail.com>
Subject Re: ClassCastException in UISelectItem
Date Fri, 02 Dec 2005 10:05:15 GMT
AFAIK the converter is responsible for the itemValue. There is no
special converter for itemLabel. You have to use a String instance for
itemValue.

2005/12/2, Luciano Medina <lmedina@tissat.es>:
>
> Sorry, I meant the itemLabel (not itemValue) attribute.
>
> -----Mensaje original-----
> De: Luciano Medina [mailto:lmedina@tissat.es]
> Enviado el: viernes, 02 de diciembre de 2005 10:51
> Para: 'MyFaces Discussion'
> Asunto: ClassCastException in UISelectItem
>
> Hello,
>
> If the itemValue attribute in f:selectItem binds to a bean property that is
> not a String (I'm using a Long), a ClassCastException is thrown. Is this
> correct behaviour? I'd imagine that the internal converter should avoid this
> inconvenience, but I don't know what the JSF standard says about it.
>
>
>
> java.lang.ClassCastException
>         at
> javax.faces.component.UISelectItem.getItemLabel(UISelectItem.java:85)
>         at
> org.apache.myfaces.util.SelectItemsIterator.hasNext(SelectItemsIterator.java
> :75)
>         at
> org.apache.myfaces.renderkit.RendererUtils.internalGetSelectItemList(Rendere
> rUtils.java:479)
>         at
> org.apache.myfaces.renderkit.RendererUtils.getSelectItemList(RendererUtils.j
> ava:455)
>         at
> org.apache.myfaces.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioR
> endererBase.java:87)
>         at
> org.apache.myfaces.renderkit.html.ext.HtmlRadioRenderer.encodeEnd(HtmlRadioR
> enderer.java:71)
>         at
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
>         at
> org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:44
> 4)
>         at
> org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java
> :421)
>         at
> org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:44
> 2)
>
>
>
>
> ------------------------------------------------------------------------------------------------------------------------------------
> Nota Legal: Este correo electronico puede contener informacion estrictamente confidencial
y es de uso exclusivo del destinatario, quedando prohibida a cualquier otra persona su revelacion,
copia, distribucion, o el ejercicio de cualquier accion relativa a su contenido. Si ha recibido
este correo electronico por error, por favor, conteste al remitente, y posteriormente proceda
a borrarlo de su sistema. Gracias por su colaboracion.
>
> Confidentiality notice: This e-mail message may contain confidential and/or legally privileged
information and is solely for the attention and use of the intended recipient. Any disclosure,
copying, distribution or the taking of any action with relation to  the contents of this e-mail
by any other person is strictly prohibited. If you believe that this e-mail has been mistakenly
sent  to you, please reply to the sender from whom you received the message in error and then
delete the original e-mail from your system. Thank you for your co-operation.
> ------------------------------------------------------------------------------------------------------------------------------------
>
>


--
Mathias

Mime
View raw message