Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7759845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:43:46+00:00 2026-06-01T13:43:46+00:00

i have a main form that contains an inner form (that inner form appears

  • 0

i have a main form that contains an inner form (that inner form appears in edit case only)
and i want both forms to be separated from each other, than when submitting the main form the inner is not submitted, how to do so ?

here’s a snippet:

<h:form id="mainForm">

  <!-- some inputs here -->

  <h:commandButton value="submit main" action="#{myBean.mainSubmit()}" />

 <h:panelGroup rendered="#{myBean.editMode}"> 
    <h:form id="innerForm"> 
      <!-- some inputs here -->

      <h:commandButton value="submit inner" action="#{myBean.innerSubmit()}" />
    </h:form>
 </h:panelGroup>

 </h:form>

Current Behavior: when submitting mainForm the inner form is submitted too, but when submitting the inner form the main is not submitted.

Desired Behavior: when submitting the mainForm the inner is not submitted, and when submitting the inner, the main doesn’t get submitted too.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:43:47+00:00Added an answer on June 1, 2026 at 1:43 pm

    Nested Forms are not something that you really want to have in your pages…

    How about this approach? wrap in two panels and use ajax to execute/render them

    <h:form id="mainForm">
     <h:panelGroup id="FirstPanel" rendered="#{myBean.editMode}"> 
      <!-- some inputs here -->
      <h:commandButton value="submit main" action="#{myBean.mainSubmit()}" >
          <f:ajax execute="FirstPanel" render="FirstPanel"></f:ajax>
      </h:commandButton>
     </h:panelGroup>
    
     <h:panelGroup id="SecondPanel" rendered="#{myBean.editMode}"> 
       <!-- some inputs here -->
       <h:commandButton value="submit inner" action="#{myBean.innerSubmit()}" >
           <f:ajax execute="SecondPanel" render="SecondPanel"></f:ajax>
       </h:commandButton>
     </h:panelGroup>
    </h:form>
    

    You can place as many <h:panelGroup that you want and add their id’s in the render execute of your f:ajax for example f:ajax execute="FirstPanel ThirdOne AnotherOne"…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form MainForm which is a Windows Forms form that contains many
I have an app that opens a non-modal form from the main form. The
I have a main form that contains two other child subforms. When a textbox
I have a ArrayList that contains values in the form [ann,john]. I want to
I have a main form, and a floating child form that is non-modal. The
I've got a situation where I have a main form that pops up an
I have a main wpf form that opens a new form. However when that
I have created a list form that gets attached to a main form in
I have a Switch to window button on my main form that I'd like
I have a Delphi application that has a document browser as the main form.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.