3 Replies Latest reply on Oct 31, 2007 1:13 PM by jgreene

    using a4j:support within h:graphicImage

    jgreene

      I'm trying to call a bean action method when a user closes a
      > rich:modalPanel. Here's the markup inside my jsp:
      >
      >
      >

       <f:facet name="controls">
      > <h:graphicImage value="../img/close.png" style="cursor:pointer"
      > onclick="Richfaces.hideModalPanel('myPanel')" >
      > <a4j:support event="onclick" action="#{myBean.cancel}"/>
      > </h:graphicImage>
      > </f:facet>
      


      > The panel closes OK, thanks to the plain old javascript call, but the bean action method does not execute. The problem is that the required a4j:support markup never gets rendered on the page, so of course the action bean method can't get called. Is there a problem using the a4j:support with a h:graphicImage JSF component?

      I also tried wrapping the h:graphicImage inside an a4j:commandLink component, and using the "action" attribute of the a4j:commandLink, but that did not work, either.

      Any ideas will be appreciated. Thanks.



        • 1. Re: using a4j:support within h:graphicImage
          ilya_shaikovsky

          move your closure JS call to oncomplete handler of a4j support ;)

          • 2. Re: using a4j:support within h:graphicImage
            jgreene

            Thanks for the response. I will try this, but I would not think that the event handler specified would have anything to do with whether the markup gets rendered or not.

            • 3. Re: using a4j:support within h:graphicImage
              jgreene

              Ok, I tried moving the javascript closure call to the "oncomplete" attribute of the a4j:support. This did not work either. It appears that the a4j:support markup does not get rendered on the page, just like in my original post.

              Since I'm trying to do this with the "close" image used in the rich:modalPanel, the image in inside the panel's facet, and is not within the form. Should this make a difference? I've tried including the facet inside the form, and it breaks my panel display.

              Any other ideas would be appreciated.