1 Reply Latest reply on Jun 2, 2011 4:07 AM by linuxhippy

    Howto re-load a Datamodel every time in a stateful session bean?

    linuxhippy
      Hi,

      I have a dataTable which updates itself frquently using the a:poll tag.

      That works perfectly fine as long as the backing bean is stateless - for every poll a new bean is created and the factory method will be invoked.

      However, I have to hold state, so with a stateful session bean, the datamodel ist just loaded once when its first accessed, and thats it.

      Is there a way I can force a re-load of the DataModel?

      Thank you in advance, Clemens

      @Stateful
      @Scope(ScopeType.SESSION)
      @Name("asyncMapManager")
      public class MapImpl implements IMap {
           
           @DataModel("mapElements")
           private List<String> mapElements = new ArrayList<String>();

          @Factory ("mapElements")
           public void getMapElements() {
               mapElements = statefulMapImpl.getTiles();
           }
           
           @Remove @Destroy
           public void remove() { }
      }