Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 一个h:form中的多个p:ajax不调用_Jsf_Primefaces - Fatal编程技术网

Jsf 一个h:form中的多个p:ajax不调用

Jsf 一个h:form中的多个p:ajax不调用,jsf,primefaces,Jsf,Primefaces,请问关于代码的问题是什么。。。第一个ajax启动,但第二个不启动。JSF有规则、表单和ajax吗?提前感谢您回答了一个幼稚的问题。它必须起作用。我以前也做过同样的事情。所以对于这个问题,我只是没有用ViewScoped注释'haf'。十) <h:form> <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5"> <h:outputText v

请问关于代码的问题是什么。。。第一个ajax启动,但第二个不启动。JSF有规则、表单和ajax吗?提前感谢您回答了一个幼稚的问题。

它必须起作用。我以前也做过同样的事情。所以对于这个问题,我只是没有用ViewScoped注释'haf'。十)
<h:form>

        <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">

            <h:outputText value="Region: " />
            <p:selectOneMenu id="regionSelection" value="#{haf.selectedRegion}" effect="fade">
                <f:selectItem itemLabel="Select One" itemValue="" />
                <f:selectItems value="#{haf.regions}" var="region"
                    itemLabel="#{region.regionName}" itemValue="#{region.regionCode}" />
                <p:ajax listener="#{haf.selectRegion}" update="provinceSelection" />
            </p:selectOneMenu>

            <h:outputText value="Province: " />
            <p:selectOneMenu id="provinceSelection" value="#{haf.selectedProvince}" effect="fade">
                <f:selectItem itemLabel="Select One" itemValue="" />
                <f:selectItems value="#{haf.provinces}" var="province"
                    itemLabel="#{province.provName}" itemValue="#{province.provCode}" />
                <p:ajax listener="#{haf.selectProvince}" update="citySelection" />
            </p:selectOneMenu>

            <h:outputText value="City/Municipality: " />
            <p:selectOneMenu id="citySelection" value="#{haf.selectedCity}" effect="fade">
                <f:selectItem itemLabel="Select One" itemValue="" />
                <f:selectItems value="#{haf.cities}" var="city"
                    itemLabel="#{city.cityName}" itemValue="#{city.cityCode}" />
                <p:ajax listener="#{haf.selectCity }" update="brgySelection" />
            </p:selectOneMenu>

            <h:outputText value="Barangay: " />
            <p:selectOneMenu id="brgySelection" value="#{haf.selectedBrgy}"
                effect="fade">
                <f:selectItem itemLabel="Select One" itemValue="" />
                <f:selectItems value="#{haf.brgys}" var="brgy"
                    itemLabel="#{brgy.brgyName}" itemValue="#{brgy.brgyCode}" />
            </p:selectOneMenu>

        </h:panelGrid>
    </h:form>