4 Replies Latest reply on Aug 9, 2008 12:55 AM by bashan

    ajax perform action

    bashan

      Hi, I am using a4j controls to make ajax request. Is it possible to execute some javascript code when response is complete? For example, I want to send a message. When user clicks send a layer pops allowing user to send message. After send button is pressed and response is complete I would like to close the layer.

        • 1. Re: ajax perform action
          sjmenden
          I haven' tested this but it should work in theory.  You'll want to use rich:modalPanel: http://livedemo.exadel.com/richfaces-demo/richfaces/modalPanel.jsf?c=modalPanel   and on the button that sends your message in the modalPanel do a oncomplete="#{rich:component('mp')}.hide()"
          • 2. Re: ajax perform action
            bashan

            Sorry. maybe I didn't explain myself well... I have no problem with showing a layer (it shouldnt be a modal popup, just a simple layer). I use a simple div and some javascript for it... my problem is with the a4j ajax. I want simply to be able to run some javascript code at the end of the ajax response. This code simply should hide the layer. Is it possible using ajax4jsf?


            Thanks.

            • 3. Re: ajax perform action
              sjmenden

              you should be able to use oncomplete on any richfaces/ajax4jsf component to run some javascript when the response has completed.  I'm not the best person to ask for this though, so if that doesn't help, you should repost your question on the Richfaces forum.

              • 4. Re: ajax perform action
                bashan

                Thanks, working great.