1 Reply Latest reply on Jul 29, 2009 12:50 AM by asookazian

    keeping result of datatable

    ajanz

      i got an ear deployed app wiht a query page with a rich:datatable.


      i want to keep the result list of the table, so every time the user comes back he will see his last result.


      first i implemented the bean with result with @Scope(ScopeTye.SESSION)


      but i think this is the wrong way....


      so i tried using @Stateful, but every time the page renders the result is newly created.


      any tips what i am doing wrong?

        • 1. Re: keeping result of datatable
          asookazian

          Use conversation scope for you backing bean (typically JavaBean or SFSB). 


          Use @Begin(join=true) on your action method (or when the page loads in pages.xml) to start a LRC (long-running conversation).  In Seam, there is always a temporary conversation but if it is not promoted to a LRC then the component will be destroyed by Seam.


          You can test this by adding the following code and a debug brkpt in your IDE:


          @Destroy
          public void destroy() { 
             log.info("in destroy");  //<-- brkpt here!
          }



          Before and after you after you add the @Begin(join=true) annotation.


          You will likely need an @End as well on your submit method or equivalent.


          Read the Seam ref doc, this is basic conversation mgmt stuff...