Primefaces向导不会继续使用selectOneMenu

时间:2013-08-15 20:05:53

标签: java jsf-2 primefaces

当我使用value="#{wizard.filial.numFilial}".时,向导不会进入下一个标签但是,当我使用value="#{wizard.intFilial}".时,它可以正常工作吗?

<!--XHTML-->
<h:selectOneMenu id="fieldFilial" title="Filial" value="#{wizard.filial.numFilial}" required="true" label="Filial*" >
    <f:selectItem itemLabel="Selecione" />
    <f:selectItems value="#{commons.filiais}"  var="cfilial"
                               itemValue="#{cfilial.numFilial}" itemLabel="#{cfilial.descricao} "/>
</h:selectOneMenu>

Wizard.java

    @ManagedBean
    @SessionScoped
    public class Wizard{
        private Filial filial;
        private int intFilial;
        <GETTERS/SETTERS>
}



**Commons.java**

    @ManagedBean
    @SessionScoped
    public class Commons{
        private List<Filial> filiais;
        <GETTERS/SETTERS>
}

<!--FILIAL-->
public class Filial implements Comparable<Filial>, Serializable {
    private int numFilial;
    private String descricao;
    <GETTERS/SETTERS>

1 个答案:

答案 0 :(得分:0)

您需要实例化filial对象,因为您需要一个包含numFilial的Filial type Object实例。

尝试

private Filial filial = new Filial();