2 Replies Latest reply on Apr 30, 2013 12:33 PM by peter.falken

    Events fired by <a4j:ajax>?

    peter.falken

      I'm using RichFaces 4.3.1 on JBoss AS 7.1

      We have an <a4j:commandButton> that uses an <a4j:ajax> to call a listener.

      Can some one help me understand if it is possible to re-write the code in cleaner fashion or I might be miss-understanding that <a4j:ajax> doesn't fire events.

       

      The original code (this works):

      <a4j:commandButton value="Cancel" immediate="true">
                <a4j:ajax listener="#{serviceManager.refresh}" oncomplete="#{rich:component('popup')}.hide(); return false;" />
      </a4j:commandButton>
      

       

      This doesn't work - but looks cleaner:

      <a4j:commandButton value="Cancel" immediate="true">
                <a4j:ajax listener="#{serviceManager.refresh}">
                          <rich:componentControl event="complete" target="popup" operation="hide" />
                </a4j:ajax>
      </a4j:commandButton>
      

       

      This doesn't work either - but looks cleaner:

      <a4j:commandButton value="Cancel" immediate="true">
                <a4j:ajax listener="#{serviceManager.refresh}">
                          <rich:componentControl event="oncomplete" target="popup" operation="hide" />
                </a4j:ajax>
      </a4j:commandButton>