Error after selecting an option from selectManyListbox
I'am using JSF2.0/primefaces,
I have an error that I can not understand it's cause, I have 2 components selectOneMenu and selectManyListbox ,when I choose an option from the first the second is filled ,the problem is when I choose an option from the second the following error appear:
f1:env1 : erreur de validation. La valeur est incorrecte
JSF :
<h:outputLabel value="Platform:" />
<h:selectOneMenu value="#{FMTools.platform}" id="platforms">
<f:selectItem itemLabel="-- Select Plateform-- " itemValue="0"/>
<f:selectItems value="#{FMTools.getMyListPaltform()}" />
<f:ajax listener="#{FMTools.UpdateChangeEnvironment()}" render="env1" />
</h:selectOneMenu>
<h:selectManyListbox value="#{FMTools.s开发者_如何转开发electedEnvironment}" id="env1" size="3">
<f:selectItem itemLabel="-- Select Environment -- " itemValue="0"/>
<f:selectItems value="#{FMTools.getMyListEnvironment()}" />
</h:selectManyListbox> //when I choose an environment the error appear
My BEAN:
private List<SelectItem> MyListEnv;
private ArrayList<String> selectedEnvironment;
public List<SelectItem> getMyListEnvironment()
{
if (MyListEnv == null) {
MyListEnv = new ArrayList<SelectItem>();
for (String val : this.getMyListEnvironmentByPlatform()) {
MyListEnv.add(new SelectItem(val));
}
}
return MyListEnv;
}
精彩评论