2 Replies Latest reply on Dec 8, 2008 12:05 PM by essepuig

    How to cancel an action

    essepuig

      Hi,


      I am creating a web application with SEAM 2.0.2 + Icefaces 1.7.2. In one of the pages, I have a popup where the user can select some options and lauch an action.
      My problem is that the business that is behind the action can take a long time to execute. So, i thought I could be a good idea to have a button to cancel the first action.
      Unfurtunatly, that doesn't work :( If the user clicks on the bussines action and after in the cancel action, the cancel action is executed only when the business action has finished.


      So, does anybody know how to implement that ?


      Thanks,


      Ezequiel

        • 1. Re: How to cancel an action
          jguglielmin

          See seam-comp-showcase example of progressMonitor which shows a thread spinning off to do a task.  In web.xml, you need to make sure you have the following

              <context-param>
                  <param-name>com.icesoft.faces.synchronousUpdate</param-name>
                  <param-value>false</param-value>
              </context-param>
          


          to ensure asynchronous processing.  Also, make sure to keep a reference to the thread (that your action spins off) in the bean so you can cancel it.

          • 2. Re: How to cancel an action
            essepuig

            That can sound stupid, but where do I find the seam-comp-showcase ?? I have look everywhere and I don't find it :(. And how do I keep a reference to the thread in the bean ??


            Thanks,


            Ezequiel.