1 Reply Latest reply on Oct 22, 2008 6:14 AM by nbelaevski

    a4j:commandButton - oncomplete method

    kdcosta

      Hi

      i have a <a4j:commandButton>. its action method is binded to my backend method. and i have used the oncomplete attribute to call a javascript alert to show a message that the backend process is completed.

      Button action method is used to read a set of files in a folder and analyze it.It will take time depending upon the number of files in the folder.

      My problem is that, if there is only few files(i.e if the action is completed in less than an hour) it will show the oncomplete alert correctly. but if there are more files and when the action takes more than 1 hr, the oncomplete message is shown before completion i.e after 45-50min , but at the console we see the action is still going on.

      is there is any way to solve it???
      is it because i have any values in any of xml's to show the response after 45-50min???

      Plz help me.

      Rgds
      Kdcosta

        • 1. Re: a4j:commandButton - oncomplete method
          nbelaevski

          Use "timeout" attribute of a4j:commandButton. It sets the time in ms to wait for response.

          Note: HTTP standard limits simultaneous connections to server to two only. I would recommend not to use such long-running AJAX requests but use a4j:poll or rich:progressBar instead.