0

I work on a xhtml page which uses two tabs which contain command buttons.

After one command button clicked in Tab1, which contains "Person Information", then the other tab, which has "Address Information" is opened.

My second tab has selectOneMenu with using p:ajax listener. After clicking first button, second tab is not visible, and besides the command button in the Tab1 is not fired.

After using different components such as outputText, components of Tab2 became visible. Could you have any solution for this problem?My code is as shown in below:

Code:

<h:form>
    <p:accordionPanel>
        <p:tab title="Person Information">
            <h:panelGrid>
                <p:selectOneMenu filterEnable="true"
                                 disabled="#{bean1.disableChoosePerson}" required="true"
                                 value="#{bean1.person}">
                    <f:selectItems value="#{bean1.personList}" />
                </p:selectOneMenu>
            </h:panelGrid>
                        
            <p:commandButton value="save" rendered="#{bean1.renderSave}"
                             action="#{bean1.actionSavePerson}" />
        </p:tab>

        <p:tab title="Address Information"
               disabled="#{bean1.adressDisabled}">
            <h:panelGrid>
                <p:selectOneMenu value="#{bean1.selectedProvince}"
                                 required="true">
                    <p:ajax listener="#{bean1.actionHandleChangeProvince}" />
                    <f:selectItems value="#{bean1.provinceList}" />
                </hm:selectOneMenu>
            </h:panelGrid>
                        
            <h:panelGrid>
                <hm:commandButton value="save" rendered="#{bean1.renderSave}"
                                  action="#{bean1.actionSaveAddress}" />
            </h:panelGrid>
        </p:tab>
    </p:accordionPanel>
</h:form>
fuggerjaki61
  • 822
  • 1
  • 11
  • 24
  • 3
    Please read https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value – Jasper de Vries Aug 19 '20 at 14:01
  • And please read [ask] an [mcve] – Kukeltje Aug 19 '20 at 14:06
  • 3
    Does this answer your question? [commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated](https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value) – Melloware Aug 21 '20 at 11:57

0 Answers0