Problème avec selectManyListbox
Salut,
Mon idée c'est de récuperer les noms des fichiers dans une répertoire puis je l'affiche dans une selectManyListbox ( JSF ).Alors je créer dans mon bean (signature):
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
private List options;
public void setOptions(List options) {
this.options = options;
}
public List getOptions() {
return options;
}
public Sigbean(){
}
public void FilesActives() {
options = new ArrayList();
SelectItem option = new SelectItem();
String directoryPath="//etc//snort//rules//";
File directory = new File(directoryPath);
File[] subfiles = directory.listFiles();
for(int i=0 ; i<subfiles.length; i++){
option = new SelectItem( subfiles[i].getName());
options.add(option);
}
} |
et dans la page JSF:
Code:
1 2 3 4
|
<h:selectManyListbox id="listbox1" value="#{signature.options}" size="3" style="height: 216px; left: 120px; top: 168px; position: absolute">
<f:selectItems value="#{signature.options}" />
</h:selectManyListbox> |
Mais il m'affiche l'erreur suivant
Code:
1 2 3
|
Exception Details: java.lang.IllegalArgumentException
Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectMany(listbox1). Found null. |
Svp y a-t-il une proposition?? :(
Merci d'avance.