3 Replies Latest reply on Aug 6, 2008 4:08 PM by System Administrator

    Help on Submitting multiple Forms At a time

    Muruga boopathy Newbie
      Hi ,
         I have a page designed in richfaces , i have added my components like texfield and textarea,command button inside a different rich panel under different form and the forms are inside the a4joutputPanel , iam re-rendering the output panel based on the selection from a different component , when i render the second panel , the field values inside the first output panel is cleared. Please suggest me how to get those values....

      Here is my code snippet.
         <a4j:outputPanel id="p1">
         <h:form>
         <rich:panel><h:inputText id="t1" value="#{backBean.t1}" /></rich:panel>
         </h:form></a4j:ouputPanel>
         <a4j:outputPanel id="p2">
         <h:form>
         <rich:panel><h:inputText id="t2" value="#{backBean.t2}" /></rich:panel>
         </h:form></a4j:ouputPanel>
         <a4j:outputPanel id="p1">
         <h:form>
         <rich:panel><h:commandButton action="#{backBean.update}"></h:commandButton></rich:panel>
         </h:form></a4j:ouputPanel>
        • 1. Re: Help on Submitting multiple Forms At a time
          Adrian Mitev Master

          Because it's unpossible to submit multiple forms at once.

          • 2. Re: Help on Submitting multiple Forms At a time
            Muruga boopathy Newbie
            Hi Adrian,
               Thanks for your reply, Can you suggest me how to post all the field values which is inside a seperate output panel .. iam using a4j support to re-render the panel whenever i re-render a new output panel ,the values entered in the previous output panel was cleared, and after submiting the page it does nothing and returning to the same page ... Will this code work ??

            <a4j:outputPanel id="p1">
                <rich:panel><h:inputText id="t1" value="#{backBean.t1}" /></rich:panel>
              </a4j:ouputPanel>
               <a4j:outputPanel id="p2">  
               <rich:panel><h:inputText id="t2" value="#{backBean.t2}" /></rich:panel>
               </a4j:ouputPanel>
              
               <h:form>
               <rich:panel><h:commandButton action="#{backBean.update}"></h:commandButton></rich:panel>
               </h:form>
            • 3. Re: Help on Submitting multiple Forms At a time
              System Administrator Expert

              In your first code example, not sure why you need so many a4j:outputPanel and h:form components...


              I didn't even see a reRender attribute anywhere...


              Try this and reRender panel1, form1 or individual h:inputText components as required.  Keep it simple!


              <rich:panel id="panel1">
                   <h:form id="form1">
                       <h:inputText id="t1" value="#{backBean.t1}"/>
                       <h:inputText id="t2" value="#{backBean.t2}"/>
                       <h:commandButton action="#{backBean.update}"/>
                   </h:form>
              </rich:panel>