[jboss-user] [JBoss Seam] - Outjected variables flawed.

tony.herstell@gmail.com do-not-reply at jboss.com
Thu Feb 7 23:38:44 EST 2008


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}">
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127668#4127668

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127668



More information about the jboss-user mailing list