1

I am having a rich:popupPanel on page which takes some text as input and I have put validation on that input text field. Now if we press <a4j:commandButton> first time it will execute everything properly, but second time won't work.

<a4j:commandButton styleClass="button" id="addFieldBtn" value="#{msg.Add}"
   oncomplete="if(#{messageDataBean.isSuccess}) {#{rich:component('fieldPopUp')}.hide();}"
   action="#{categoryServiceBean.addAddtionalFields}" render="fieldList"/>

My messageDataBean and categoryServiceBean are request scoped.

Emil Sierżęga
  • 1,785
  • 2
  • 31
  • 38
  • is your button in popupPanel or...??? – Mango May 23 '12 at 04:04
  • yes it is in popupPanel. – Satyajitsinh Raijada May 23 '12 at 04:31
  • do you have mutiple forms..??? if so are they nested forms or multiple forms..?? – Mango May 23 '12 at 04:51
  • i have multiple forms but are not nested, all the forms are separate. for exp, one main form which will call popupPanel and for popupPanel have another from, and is not nested. – Satyajitsinh Raijada May 23 '12 at 05:09
  • I had a similar issue while working with .. try making the main form as , end it before popupPanel starts and make the form which contains popupPanel as ...hope it works for you as well – Mango May 23 '12 at 05:13
  • hey @Mango it seems to be a good idea, but i am using richfaces 4.2.1.final and i think a4j:form is supported in richfaces 3.x and not in 4.x, i am finding way to do so in 4.x give me hint if you know anything about it, thanks. – Satyajitsinh Raijada May 24 '12 at 04:59
  • are you getting any error when tried replacing with in richfaces4.x – Mango May 24 '12 at 08:52
  • its not available. i am using netbeans so it will show me error when trying to put on page. – Satyajitsinh Raijada May 28 '12 at 06:00
  • possible duplicate of [ action is only invoked on second click](http://stackoverflow.com/questions/10094615/a4jcommandbutton-action-is-only-invoked-on-second-click) – Bob Apr 16 '15 at 08:22

0 Answers0