XHTML:號碼:selectOneMenu用於:驗證錯誤:值無效
<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>
豆:
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;
}
按鈕:
<h:commandButton action="#{chamadoBean.salvar}" value="Abrir Chamado" />
error: Validation Error: Value is not valid
當我使用p:commandButton
從PrimeFaces,然後它可以工作,但它不會重定向t他的頁面。當我把ajax="false"
爲了重定向,然後我再次得到相同的錯誤。
什麼'chamadoBean.salvar'? –
@Bhesh:實際上是'callBean.save'。 – BalusC
@caematos:'
'**應該**有同樣的問題。當你說「它有效」時,你不*實際上*是指「我沒有看到任何錯誤」,或者你真的是指「操作方法被調用」? – BalusC