2012-03-25 4 views
0

Hallo ich benutze primefaces Version 3.2 Das Layout, das ich verwende, ist Tabview, darin habe ich Akkordeon Panel, und in jedem Tab des Akkordeons, ich ' zwei Formen.Primefaces, activeindex actionlistener ruft nicht mehrere Tabs auf

Genau wie

TabView> tab> accordionpanel> tab> form1 und

TabView> tab> accordionpanel> tab> form2 und so weiter ...

Nun, das Problem ist, dass die aktive Indexaktion im obigen Szenario nicht aufgerufen wird. Allerdings, wenn ich eines der From aus dem Akkordeon Panel Tab entferne, wird es aufgerufen und funktioniert gut.


Das ist mein xhtml TabView Code

 <p:tabView id="tabView" activeIndex="#{profileInfoManagedBean.myCurrentTab}" > 
      <p:ajax event="tabChange" listener="#{profileInfoManagedBean.tabIsChanged}" /> 

      <p:tab id="locationInfoTab" title="Location Info"> 

       <p:accordionPanel id="aPanel"> 

        <p:tab id="tab1" title="Country"> 
         <h:form id="form1"> 
          <p:growl id="growl" life="5000" /> 

          <p:messages id="messages" /> 

          <h:panelGrid columns="3" cellpadding="5" cellspacing="5"> 

           <p:column> 
            <h:outputLabel for="country" value="Country: "></h:outputLabel> 
           </p:column> 
           <p:column> 
            <p:inputText id="country" value="#{profileInfoManagedBean.country.country}" required="true" label="City"> 

             <f:validateLength minimum="5" maximum="20" /> 
             <p:ajax event="blur" update="msg1"></p:ajax> 
            </p:inputText> 
           </p:column> 
           <p:column> 
            <p:message id="msg1" for="country" display="icon"></p:message> 
           </p:column> 

          </h:panelGrid> 
          <p:commandButton type="submit" action="#{profileInfoManagedBean.addCountry}" value="Save" ajax="true" ></p:commandButton> 

         </h:form> 
         <p:separator /> 

         <h:form id="countryDataTableForm"> 
          <p:panel> 
           <p:growl id="messagesww" /> 
           <p:confirmDialog id="confirmDialog" message="Are you sure you want to delete the selected row ?" 
               header="Deleting Row" severity="alert" widgetVar="confirmation1"> 
            <p:commandButton id="confirm" value="Yes Sure" update="messagesww" oncomplete="confirmation1.hide()" 
                action="#{profileInfoManagedBean.deleteObject}" /> 
            <p:commandButton id="decline" value="Not Yet" onclick="confirmation1.hide()" type="button" /> 
           </p:confirmDialog> 

           <p:dataTable style="width: 700px;" var="coun" value="#{profileInfoManagedBean.countryList}" selection="#{profileInfoManagedBean.deletingObj}" rowKey="#{coun.countryId}" 
              paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
              paginator="true" rows="5" rowsPerPageTemplate="10,15,20,25" editable="true"> 
            <p:ajax event="rowEdit" update="@this" 
              listener="#{profileInfoManagedBean.onEditRow}" /> 


            <p:column headerText="Country"> 
             <p:cellEditor> 
              <f:facet name="output"> 
               <h:outputText value="#{coun.country}" /> 
              </f:facet> 
              <f:facet name="input"> 
               <p:inputText value="#{coun.country}" style="width:100%" /> 
              </f:facet> 
             </p:cellEditor> 
            </p:column> 

            <p:column id="inactive" filterBy="#{coun.isActive}" 
               headerText="isActive" footerText="exact" 
               filterOptions="#{profileInfoManagedBean.isActiveDropDown}" 
               filterMatchMode="exact"> 

             <p:cellEditor> 
              <f:facet name="output"> 
               <h:outputText value="#{coun.isActive}"></h:outputText> 
              </f:facet> 
              <f:facet name="input"> 
               <h:selectOneMenu value="#{coun.isActive}" > 
                <f:selectItem itemLabel="True" itemValue="true" /> 
                <f:selectItem itemLabel="False" itemValue="false" /> 
               </h:selectOneMenu> 
              </f:facet> 
             </p:cellEditor> 
            </p:column> 

            <p:column headerText="Edit"> 
             <p:rowEditor /> 
            </p:column> 

            <p:column headerText="Delete"> 

             <p:commandButton type="button" onclick="confirmation1.show()" 
                 id="delCountry" title="Delete Country" icon="ui-icon ui-icon-trash" /> 
            </p:column> 

            <p:column selectionMode="single"> 
             <f:facet name="header"> 
              <h:outputText value="select" /> 
             </f:facet> 
            </p:column> 


           </p:dataTable> 
          </p:panel> 

         </h:form> 
        </p:tab> 

       </p:accordionPanel> 

      </p:tab> 

      <p:tab id="basicInfoTab" title="Basic Info"> 
       <p:accordionPanel id="aPanel2"> 
        <p:tab id="tab2" title="basic info"> 
         <h:form id="dkk"> 
          This is basic info tab. 
         </h:form> 
         <h:form id="ddkk"> 
          This is basic info tab. 
         </h:form> 
        </p:tab> 
       </p:accordionPanel> 
      </p:tab> 

     </p:tabView> 




I've got multiple tabs in the tabview and also multiple tabs in each accordion panel. 

    Waiting for the response. 

Antwort

0

Verwendung

<p:tab id="tab1" title="Quick Search"> 
<p:commandButton process="tab1" value="Search" 
actionListener="#{TTCPage.searchTrackTime}" id="searchval" update="track"/> 
+0

Ich benutze aktiven Index hier, dass wann immer eine Registerkarte angeklickt wird, es in der gebundenen Bean-Member-Variable gespeichert wird. In Ihrem Vorschlag, ich muss die Befehlsschaltfläche drücken, um es zu tun und nicht die Registerkarte. Bitte erklären Sie, wenn Sie nicht sagen wollten, was ich von ur-Code bekommen habe. Danke –

0

Ist Ihr Bean im Hinblick scoped? Wenn Sie einen Breakpoint im Getter von myCurrentTab setzen, stoppt es im Debug-Modus?

+0

Meine Bohne ist Sitzung scoped. und im Debug-Modus, wenn ich bei der Anweisung "return myCurrrentTab" übergehe, geht es zu der return-Anweisung der Methode invoke der Method.java-Klasse. Aber es stoppt den Debugger nicht. –

+0

Plz jemand antworten –

+0

Brauchen Sie wirklich die AccordionPanel-Panel ?, Ich hatte immer Probleme mit komplexen Komponenten in Tabs. Vielleicht können Sie bei den Hauptgesichtern fragen. Oder Sie könnten eine andere Komponente verwenden. –