1 Reply Latest reply on Jun 21, 2007 2:53 PM by Bradley Smith

    @Out problem (Seam 1.2.1)

    Bradley Smith Master

      I'm probably missing something trivial, but I am stuck with an @Out issue and hopefully someone can point something out.

      First, I have a Seam component that is JavaBean; annotated as such:

      @Roles( {
       @Role(name="accessRequestUser", scope=ScopeType.CONVERSATION),
      } )
      public class EvergreenUser implements Serializable {

      I have a method in a SFSB that will, based on the value of a @RequestParameter, here is the relative code:

      public class AccessRequestManager2Bean implements AccessRequestManager2 {
       private Log log;
       @PersistenceContext(unitName = "accessControlDatabase")
       private EntityManager em;
       private UserPrincipal userPrincipal;
       @In(required = false)
       private Integer currentStep;
       private Conversation conversation;
       @In(create = true)
       private DraftAccessRequestMaster draftAccessRequestMaster;
       private String selectedUserId;
       private List<String> errors = new ArrayList<String>();
       @Out(required = false)
       private EvergreenUser accessRequestUser;
       * Start a new add-access request. This method also generates the conversationId to
       * use in the conversation that beans of this class are associated with.
       @Begin(id = "DraftAccessRequestID:#{draftAccessRequestMaster.id}", join = true)
       public void startAddRequest() {
       currentStep = 1
       * Step 2.
       * Select user to clone (optional)
       * Select 1-or-more applications and entitlements
       public void editAccessRequestDetails() {
       if (selectedUserId == null) {
       log.error("User not Selected...TODO - bounce back to step 1.");
       log.info("selectedUserId -> " + selectedUserId);
       accessRequestUser = QueryEPeopleUtil.findUserByUid(selectedUserId);
       log.info("accessRequestUser -> " + accessRequestUser);
       currentStep = 2

      And I use an <s:link ... /> tag to call editAccessRequestDetails()

       <s:link value="#{eUser.name}"
       action="#{accessRequestManager2.editAccessRequestDetails}" propagation="join">
       <f:param value="#{eUser.anumber}" name="selectedUserId"/>

      I also have a navigation rule in pages.xml so that when editAccessRequestDetails() is called, another page is displayed

       <page view-id="/user_access_request_step_1.xhtml">
       <navigation from-action="#{accessRequestManager2.editAccessRequestDetails}"
       <rule if-outcome="1">
       <redirect view-id="/user_access_request_step_1.xhtml"/>
       <rule if-outcome="2">
       <redirect view-id="/user_access_request_step_2.xhtml"/>
       <navigation from-action="#{accessRequestManager2.cancel}">
       <redirect view-id="/index.xhtml"/>

      I want to display the @Out-jected accessRequestUser on user_access_request_step_2.xhtml (which is where we land after clicking the s:link)

      (from user_access_request_step_2.xhtml)
      ... more markup ....
      <h:outputText value="#{accessRequestUser}"/>

      I can see from the log file that the SFSB method is being called, and that the accessRequestUser is being populated by my code, however, the user_access_request_step_2.xhtml page is not able to 'find' the accessRequestUser in any scope (display of attributes or the entire instance is blank). I must be missing something, I've looked this over and over and I can't figure out why @Out isn't working ... help?

      Brad Smith

        • 1. Re: @Out problem (Seam 1.2.1)
          Bradley Smith Master

          Never mind.

          Apparently, it's the redirect in pages.xml

          <rule if-outcome="2">
           <redirect view-id="/user_access_request_step_2.xhtml"/>

          that's causing the problem. I changed to render and now the @Outjection is working.

           <rule if-outcome="2">
           <render view-id="/user_access_request_step_2.xhtml"/>