Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSF Conversion error for h:selectManyListbox

843844Aug 13 2008 — edited Aug 14 2008

There's an exception (*Conversion error occurred*) from JSF on <h:selectManyListbox> component for id availableUsers which is bound to myBean*.*roleId


Now myBean*.*roleId is of Long datatype and so is the usersList*.*SelectItem*.*value. So, would not be any datatype mismatch. Tried using a converter too with no luck.


If you have come across any such issue, please do let me know, thanks!



-----------------------------------------


Exception


-----------------------------------------



javax.faces.model.SelectItem@1b115c1b]


[8/14/08 1:59:44:645 IST] 00000061 jsf E com.sun.faces.context.FacesContextImpl addMessage Adding Message[sourceId=emailmessage:*availableUsers* ,summary=*Conversion error occurred*.)


[8/14/08 1:59:44:661 IST] 00000061 jsf E com.sun.faces.context.FacesContextImpl addMessage Adding Message[sourceId=emailmessage:selectedUsers,summary=Conversion error occurred.)



-----------------------------------------

*
JSF

*

-----------------------------------------


<h:selectManyListbox id="*availableUsers* " value="#{myBean.roleId}" converter="javax.faces.Long"


binding="#{myBean.usersListBox}" size="5" style="width: 138px; height: 102px">


<f:selectItems id="usersItems" value="#{myBean.usersList}"


binding="#{myBean.usersListBoxSelectItems}" />


</h:selectManyListbox></td>



-----------------------------------------

*
CLASS

*

-----------------------------------------

*{code}*
*class MyBean*

*private Long roleId;*

*private List usersList;*
*{code}*

usersList is an arraylist of SelectItem where each SelectItem is composed of a Long value and a String label as per the convention.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 11 2008
Added on Aug 13 2008
7 comments
773 views