xhtml:
<p:selectOneMenu id="tipo" value="#{chamadoBean.chamado.tipoChamado}" effect="drop" style="width:180px">
<f:selectItem itemLabel="Tipo de Chamado" />
<f:selectItems value="#{chamadoBean.tipoChamado}" var="tipo" itemValue="#{tipo}" itemLabel="#{tipo}" />
</p:selectOneMenu>
bean:
public List<String> getTipoChamado() {
if (this.tipoChamado == null) {
this.tipoChamado = new ArrayList<String>();
this.tipoChamado.add("Reclamação");
this.tipoChamado.add("Sugestão");
}
return tipoChamado;
}
button:
<h:commandButton action="#{chamadoBean.salvar}" value="Abrir Chamado" />
error: Validation Error: Value is not valid
When I use the p:commandButton
from PrimeFaces, then it works, but it don't redirect the page. When I put ajax="false"
in order to redirect, then I get the same error again.