Iam在我的頁面中有四個選擇菜單。我的問題很奇怪,即如果你點擊提交,沒有選擇任何下拉菜單,它工作正常。但是,當我選擇亞組下拉菜單,以後如果我點擊提交按鈕,它不調用它打算叫......我的繼承人代碼的方法..在選擇框進行更新後,Primefaces Commandbutton不起作用
<?xml version="1.0"?>
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head/>
<h:body>
<h:form id="form">
<p:panel header="Service Details" style="width:800px">
<p:panelGrid columns="4">
<h:outputText value="Group: " />
<p:selectOneMenu value="#{helpDeskBean.group}">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{helpDeskBean.createRequestDTO.groupsList}" var="item" itemLabel="#{item.groupdesc}" itemValue="#{item.groupid}" />
<p:ajax event="change" listener="#{helpDeskController.groupChange}" update="subGroupID" partialSubmit="true"/>
</p:selectOneMenu>
<h:outputText value="Sub Group: " />
<p:selectOneMenu value="#{helpDeskBean.subGroup}" id="subGroupID">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{helpDeskBean.groupChangeList}" var="item2" itemLabel="#{item2.subGroupDesc}" itemValue="#{item2.subGroupCode}" />
<p:ajax event="change" listener="#{helpDeskController.SubGroupChange}" update="serviceID" />
</p:selectOneMenu>
<h:outputText value="Service: " />
<p:selectOneMenu value="#{helpDeskBean.service}" id="serviceID">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{helpDeskBean.groupChangeList}" var="item1" itemLabel="#{item1.serviceDesc}" itemValue="#{item1.serviceCode}" />
</p:selectOneMenu>
</p:panelGrid>
</p:panel>
<p:commandButton value="Submit" actionListener="#{helpDeskController.createHDRequest}"/>
</h:form>
</h:body>
查看您的JavaScript控制檯(網絡選項卡)中的線索。可能有缺失的驗證/轉換錯誤 – kolossus