myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <>
Subject SelectItem containing Integer question
Date Sat, 09 Jan 2010 13:07:15 GMT

I'm currently using Mojarra-2.0.1 and MyFaces-2.0.0-SNAPSHOT in parallel, testing out a few

One of the compatibility problems I got was with using 

in my backing bean:

public SelectItem[] getRooms() {
  item[i] = new SelectItem( roomIntegerId, roomName );

for MyFaces, I need to use
public void setSelectedRooms(List<Integer> selectedRooms) {

whereas for Mojarra, I need to use
public void setSelectedRooms(List<String> selectedRooms) {

otherwise I get a ClassCastException. 

Which implementation is doing it correct and which one is wrong?

>From looking at Suns SelectItem 2.0 JavaDoc, 

> Object getValue()
> Return the value of this item, to be delivered to the model if this item 
> is selected by the user.

I'd say MyFaces is doing it right (SelectItem would not have an Object but a String parameter
otherwise ...)
But I'm not sure since mojarra is still the RI.

txs and LieGrue,


View raw message