dataFileItems in the backing bean should return a Map or an array of
SelectItem[].

Regards.
Guillermo.

-----Original Message-----
From: Caroline Jen [mailto:[EMAIL PROTECTED] 
Sent: Martes, 11 de Octubre de 2005 10:27 a.m.
To: [email protected]
Subject: UISelectMany and Argument Type Mismatch

I used the UISelectItem to set its value to the
SelectItem (I have many SelectItme).  Then,  I added
each UISelectItem to the UISelectMany .  When I
displayed a list box, I got the runtime error:

"IllegalArgumentException: argument type mismatch"

In my JSP, I create a list box for multiple
selections: 

[code]
        <h:selectManyListbox
binding="#{fileManagementBean.dataFile}" size="7" >
            <f:selectItems
value="#{fileManagementBean.dataFileItems}"/>
        </h:selectManyListbox>
[/code]

Therefore, the "dataFileItems" is of type UISelectMany
that has elements of type UISelectItem.  The multiple
selections that users make will be in a String array:
String[] dataFile.  Did I mess up anything here?  My
backing bean code is like:

[code]
.....
.....
public class FileManagementBean 
{
        private String[] dataFile;
        private UISelectMany dataFileItems;
        
        public FileManagementBean() 
        {
                dataFileItems = new UISelectMany();
                UISelectItem item = new UISelectItem();

                SelectItem file = new SelectItem( "file1", "Data
File No. 1");
                item.setValue( file );
                dataFileItems.getChildren().add( item );
                file = new SelectItem( "file2", "Data File No. 2");
                item.setValue( file );
                dataFileItems.getChildren().add( item );
.....
.....
        }

        public String[] getDataFile() {
                return dataFile;
        }

        public void setDataFile( String[] dataFile ) {
                this.dataFile = dataFile;
        }

        public UISelectMany getDataFileItems() {
                return dataFileItems;
        }
}
[/code]


        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. 
Cualquier opinion en el contenido, es exclusiva de su autor y no representa 
necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, 
reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira 
responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta 
o alterada contenida en este mensaje. Si usted ha recibido este mensaje por 
error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con 
todas las copias del mismo, notificando al remitente. No debera utilizar, 
revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si 
usted no es el destinatario. Muchas gracias.


Reply via email to