Your return value must be of the the type SelectItem
-----Original message-----
From: SANTINI, Rafael <[email protected]>
Sent: Tue 21-07-2009 16:53
To: MyFaces Discussion <[email protected]>;
Subject: : value is not a valid option
Hi,
I can't figure out why the following code results in "value is not a valid
option":
<h:messages/>
<h:form>
<t:selectOneMenu value="#{bean.opcao}" id="opcao">
<f:selectItem itemLabel="Opção 1" itemValue="1"/>
<f:selectItem itemLabel="Opção 2" itemValue="2"/>
<f:selectItem itemLabel="Opção 3" itemValue="3"/>
</t:selectOneMenu>
<h:message for="opcao"/>
<h:commandButton value="OK"/>
</h:form>
public class Bean {
private Integer opcao;
public Integer getOpcao() {
return opcao;
}
public void setOpcao(Integer opcao) {
this.opcao = opcao;
}
}
Thanks,
Rafael Santini