خرید بک لینک

Vote count: 0

I try to display an if a value was selected in a picklist

My html, the first picklist trigger the event to reRender the second picklist

                                <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>

And there is the test() function in controller:

public boolean test() {

    if (listServices == null) {
        retu false;
    } else {

        boolean test = false;
        for (String s : listServices) {
            if (Integer.parseInt(s) == 2) {
                test = true;
            }
        }

        retu test;

    }
}

When I pick the item with ID 2 in the pick list, my function is called and it retu true, but the second pick list still not display

Thank you, and sorry for english mistaken note i am a newbie in all of this

Zel'

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 19 خرداد 1395 ساعت: 15:29

صفحه بندی