3 Replies Latest reply on Oct 31, 2012 3:02 PM by Dave Chen

    rich:modalPanel controls command action is not invoked

    Dave Chen Master

      <rich:modalPanel ...>

       

      <f:facet name="controls">

           <h:panelGroup>

               <a4j:commandLink id="cancel"  value=""    

                   action="#{bean.closeModalPanel}"   

                   onclick="#{rich:component('modalPanel')}.hide();">               

                        <h:graphicImage value="/images/close.gif" />

               </a4j:commandLink>           

           </h:panelGroup>

      </f:facet>

       

      ....

      </rich:modalPanel>

       

       

      when clicking the close image, the modalPanel is closed, but the action is not invoked.

      ajax request is not sent.  I looked at the html code, the onclick seems correct.

       

      Thanks for any help.

      Dave

        • 1. Re: rich:modalPanel controls command action is not invoked
          Siva P Master

          Hi Dave,

           

          onclick of the model panel you are trying to close the modelPanel.try with oncomplete.

          OR

          If you are trying to close the popup and you need to call the backend means try like this,

           

          <f:facet name="controls">

                          <h:panelGroup layout="block" >

                              <h:graphicImage value="/img/close.png"                      

                                  styleClass="hidelink" id="hidelinks1" />

                              <rich:componentControl for="feedbackSuccessUp" attachTo="hidelinks1"

                                  operation="hide" event="onclick" />

                          </h:panelGroup>

                      </f:facet>

           

          instead of <h:graphicsImage try with h:commandbutton also.

           

          It will also work perfectly..

           

          Thanks,

           

          Siva

          • 2. Re: rich:modalPanel controls command action is not invoked
            Christian Peter Expert

            I've never used the "controls" facet of a richfaces modalpanel. But I'd suggest analysing the rendered <a4j:commandLink> with Firebug or the chrome developertools to check if such a link is inside a form in the first place. Due to the moving around in the DOM (per default to the body) this control could be outside a form even if you specify an own form as the modalpanels content.

            1 of 1 people found this helpful
            • 3. Re: rich:modalPanel controls command action is not invoked
              Dave Chen Master

              I forgot to put it inside form. it is working now.

              Thanks.