[jboss-user] [JBoss Seam] - Calling the same method on different beans from the same act

kummer do-not-reply at jboss.com
Fri Jan 4 04:36:57 EST 2008


I am trying to reuse a facelets file in various use cases with a different stateful session bean managing each use case. 

In order to do that the beans outject themselves as "manager".  For example: 


  | @Stateful @Name("auditOrderManager") public class AuditOrderManager {
  |   @Out AuditOrderManager manager = this;
  |   @In private FacesMessages facesMessages;
  |   @Begin(nested=true) public void doSelectOrder() {...}
  | }
  | 

and


  | @Stateful @Name("cancelOrderManager") public class CancelOrderManager {
  |   @Out CancelOrderManager manager = this;
  |   @In private FacesMessages facesMessages;
  |   @Begin(nested=true) public void doSelectOrder() {...}
  | }
  | 

In an action attribute a call is made to a method, which is present on all these different managers.


  | <h:column>
  |   <f:facet name="header">Ta-Nr</f:facet>
  |   <s:link value="-" 
  |     action="#{manager.doSelectOrder}"/>
  | </h:column>
  | 

The doSelectMethod of the correct manager does get called, but appearantly the annotations have no effect.  The facesMessages component is not injected and the conversation doesn't nest. Giving a concrete component name in the action solves that problem but precludes reuse. Since the same fragment is used all over the application I would rather not have a spearate instance of it for each manager. 

Is there a way to achieve reuse in this case?

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

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



More information about the jboss-user mailing list