3 Replies Latest reply on Feb 17, 2008 8:44 PM by Tony Herstell

    Outjected variables flawed.

    Tony Herstell Master

      I keep having to put all the getters and setters into my beans and not use @Out as I need the bean to have its @Create run (which populates the variables I am Outjecting)...

      Basically: Outjecting variables means that you don't have the @Create run. for the bean that holds them

      Anyone any idea how to get round this?

      e.g.

      ...
      @SuppressWarnings("serial")
      @Stateful
      @Name("resourceAllocationController")
      @Scope(ScopeType.SESSION)
      public class ResourceAllocationControllerImpl implements ResourceAllocationController, Serializable {
      ...
      
       @Out
       private List<Day> varX;
      
      ...
      
       @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
       @Create
       public void init() {
       //set varX up
       }
      


      doesn't work... as in the view varX is accessed but init() is never run.

      You have to add in getters and setters (lots of typing) and use a construct in the view like:
      <rich:dataTable var="eachDayForIndoorArena"
       value="#{resourceAllocationController.varX}"
       rendered="#{not empty resourceAllocationController.varX}">
      


      instead of Outjecting and
      <rich:dataTable var="eachDayForIndoorArena"
       value="#{varX}"
       rendered="#{not empty varX}">