5 Replies Latest reply on Jan 4, 2011 11:22 AM by ilya40umov

    Form submission with multiple tabs

    kalgan

      I am using richfaces version 4 -m4. I have a facelet with a single form that has 2 tabs. Each tab has a rich:datatable with inputText field in them. The submit button is outside the tabPanel and it should submit the values from both the tabs into the action bean(CDI bean). I tried different switchType(s) for the rich:tabPanel. With the switchType as 'ajax', I see the form submitting the values only from the tab that is selected at that time. Nothing gets submitted with switchType 'client'. Here is the code snippet:

       

      <h:form id="cartForm1">

       

                  <rich:panel>

                      <div align="right">

                          <h:commandButton action="#{cartTestAction.submit}" value="Submit"/>

       

                      </div>

       

                      <rich:tabPanel switchType="ajax"

                                     >

                              <rich:tab name="Tab1">

                                  <rich:dataTable value="#{cartTestAction.lines1}" var="line" border="1">

                                      <rich:column>

                                          <f:facet name="header">Product</f:facet>

                                          <h:inputText value="#{line.value}">

       

                                          </h:inputText>

                                      </rich:column>

       

       

                                  </rich:dataTable>

       

                              </rich:tab>

       

                           <rich:tab name="Tab2">

                                  <rich:dataTable value="#{cartTestAction.lines2}" var="line" border="1">

                                      <rich:column>

                                          <f:facet name="header">Product</f:facet>

                                          <h:inputText value="#{line.value}">

       

                                          </h:inputText>

                                      </rich:column>

       

       

                                  </rich:dataTable>

       

                              </rich:tab>

       

                      </rich:tabPanel>

       

                  </rich:panel>

              </h:form>