4 Replies Latest reply on Jun 18, 2008 11:03 AM by benitojuarez

    perform action via AJAX

    benitojuarez

      Hello,


      how can I perform an action component via AJAX request?


      thx
      BJ

        • 1. Re: perform action via AJAX
          mkiel

          What exactly do you mean? Perhaps you're looking for this:


          <a4j:commandLink action="#{myActionBean.doSomething()}">Do something</a4j:commandLink>
          



          doSomething() is asynchronously called when the user clicks on the link. Check the RichFaces docs details.

          • 2. Re: perform action via AJAX
            benitojuarez

            Hello,


            is get an error using this code:


            Warnung: Leerer String an getElementById() übergeben.
            Fehler: this.form is null
            Quelldatei: http://localhost:8080/TestServer/a4j
            314.GAorg.ajax4jsf.javascript.AjaxScript
            Zeile: 95


            must a4j:commandLink be inside of a form?

            • 3. Re: perform action via AJAX
              amitev

              Yes the command components should be nested inside a form.

              • 4. Re: perform action via AJAX
                benitojuarez

                thx, it works


                but now i got another problem: the asynchronous called action can last 5 minutes and more. So i tried to create a progressbar according to the seam progressbar example.
                It doesn't work correctly, the bar stays at 0 percent even if the process in background reaches 100 percent. If i call the same action (without @Asynchronous) via h:commandButton, it works well.


                BJ