0

i am trying to migrate a jsf 1.x richfaces 3.x app to jsf2.x and richfaces 4.x. i have a richpopupPanel inside a form which has a form and two a4j:commandButtons. i am not able to invoke action on the secondbutton to submit the form.

the code goes as follows.

<h:form id="outsideform">
     <rich:popupPanel id="details" domElementAttachment="form">
      <f:facet name="header">
            <h:outputText value="PopuPTitle" style="text-align: center;" styleClass="center"/>
        </f:facet> 
       <a4j:commandButton id="firstButton" render = "detailsform" action="#{mybean.getDetails()}"/> 

         <h:form id="detailsForm>

           content to be submitted

        <a4j:commandButton id ="secondButton" action ="#{mybean.action()}"  render="addContent"/>

        </h:form>
        </rich:popupPanel>

The detailsForm renders succesfully on the click of the firstButton, but when make some changes in the content and try to submit by clicking on secondButton the action on the secondButton is not invoked. the form to be submitted is the detailsForm.

Vinay G B
  • 127
  • 6
  • 1
    As said by @BalusC in [this answer](http://stackoverflow.com/questions/2118656/commandlink-commandbutton-ajax-backing-bean-action-listener-method-not-invoked). You have not to build a hierarchical form structure when you are managing hierarchical or dependent data. – Javier Haro Sep 04 '15 at 17:07
  • @lametaweb thanks for your response, can you please show me how can i resolve this, because i have to go in this route since i have rich:tabPanel outside the popup which needs a form surrounding it.. – Vinay G B Sep 04 '15 at 17:42
  • Its a seam application as well, seam 2.3 is the version – Vinay G B Sep 05 '15 at 06:47

2 Answers2

0

Do not use nested h:forms. Move "details" popupPanel outside of "outsideform" form.

Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40
  • your answer worked and there was an issue with backing bean as well, now everything is solved, thanks for your time and help. – Vinay G B Sep 05 '15 at 14:50
0

Remove <h:form id="detailsForm>and add process="details" attribute to the second button.

Javier Haro
  • 1,255
  • 9
  • 14
  • putting the popupPanel outside the form worked. Actually there was an issue with backing bean as well so was not ivoked, now everything solved. Big Thanks for your time and help. – Vinay G B Sep 05 '15 at 09:37
  • @Vinay G B you have to accept the other answer, Vasil Lukach answer, not the mine one. – Javier Haro Sep 05 '15 at 10:11
  • I found another possible solution using `a4j:region` component. Look at [this page](http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=region&skin=blueSky) at Rich Faces showcase site. Line 32 and forward in the sample source code. – Javier Haro Sep 05 '15 at 12:28
  • yeah i did something similar to that now its working, thanks again. – Vinay G B Sep 05 '15 at 14:52