0
我嘗試顯示<a4j:outputPanel>
如果選擇列表JSF,A4J:支持和豐富的:領料單,重新呈現
我的HTML選擇的值時,第一選擇列表觸發的事件重新呈現第二選擇列表
<li class="clearfix"><label class="desc"><sup>*</sup>
<h:outputText value="Services :" /></label>
<div>
<span class="full"> <rich:pickList id="pickService"
value="#{GroupeController.listServices}"
copyAllControlLabel="Tout copier"
removeAllControlLabel="Tout supprimer"
copyControlLabel="Copier" removeControlLabel="Supprimer">
<a4j:support event="onlistchange" ajaxSingle="true" reRender="test" />
<f:selectItems
value="#{GroupeController.getListTypeGroupeServices()}" />
<f:facet name="copyAllControlDisabled">Tout copier
</f:facet>
<f:facet name="removeAllControlDisabled">Tout supprimer
</f:facet>
<f:facet name="copyControlDisabled">Copier
</f:facet>
<f:facet name="removeControlDisabled">Supprimer
</f:facet>
</rich:pickList>
</span> <label><rich:message errorLabelClass="req"
for="pickService" /></label>
</div></li>
</a4j:outputPanel>
<a4j:outputPanel id="test" rendered="#{GroupeController.test()}" >
<li class="clearfix"><label class="desc">
<h:outputText value="ACL existantes :" /></label>
<div>
<span class="full"> <rich:pickList id="pickACL"
value="#{GroupeController.listACLSelect}"
copyAllControlLabel="Tout copier"
removeAllControlLabel="Tout supprimer"
copyControlLabel="Copier" removeControlLabel="Supprimer">
<f:selectItems
value="#{GroupeController.getAllACL()}" />
<f:facet name="copyAllControlDisabled">Tout copier
</f:facet>
<f:facet name="removeAllControlDisabled">Tout supprimer
</f:facet>
<f:facet name="copyControlDisabled">Copier
</f:facet>
<f:facet name="removeControlDisabled">Supprimer
</f:facet>
</rich:pickList>
</span> <label><rich:message errorLabelClass="req"
for="pickACL" /></label>
</div></li>
</a4j:outputPanel>
</a4j:outputPanel>
<a4j:commandButton id="idAjouter" value="Ajouter"
action="#{GroupeController.ajouterGroupe()}"
onclick="#{rich:component('wait')}.show()" reRender="form,error"
limitToList="true" oncomplete="#{rich:component('wait')}.hide()" />
</rich:panel>
</a4j:outputPanel>
</h:form>
</rich:layoutPanel>
並且有測試()函數中的控制器:
public boolean test() {
if (listServices == null) {
return false;
} else {
boolean test = false;
for (String s : listServices) {
if (Integer.parseInt(s) == 2) {
test = true;
}
}
return test;
}
}
當我在選擇列表中選擇ID爲2的項目時,我的功能被調用並且它返回true,但第二個選擇列表仍然不顯示
謝謝,對不起英文錯誤注意我是一個新手這
ZEL」