3 Replies Latest reply on Jun 22, 2007 9:38 AM by andreigh.ts

    Conversation scoped component automatically outjected

    andreigh.ts

      Hi,
      I am injecting a component with @In, from Conversation scope(the componenet was previously created). After modifying it in the action method (triggered from xhtml), the modification is visible in view (i.e. component is outjected).

      @Stateless
      @Name("requestWizard_information")
      public class InformationAction implements Information {
      
       @In(required=false, scope=ScopeType.CONVERSATION)
       private RfqRequest rfqRequest;
      
       // this is an action called from an <s:button>
       public void testAction() {
       // this modification will be seen in the view
       rfqRequest.setName("new name");
       }
      }
      


      I understood that modifications on rfqRequest should be visible in view only if @Out is used. But it seems that it is automatically oputjected.

      Is this a bug?

        • 1. Re: Conversation scoped component automatically outjected
          azalea

          Hi,

          Yeah, that doesn't outject the rfqRequest.
          But the state of the rfqRequest instance is changed via rfqRequest#setName method.

          For example, the following facesMessages is not outjected.
          But we will see the error message in redirected view page when the error occurs.

          ......
          @In
          private FacesMessages facesMessage;
          
          public void update() {
           ......
          
           if (error) {
           facesMessages.add("error occured!!!");
           }
           ......
          }
          ......
          


          I think that is a same thing as this.


          • 2. Re: Conversation scoped component automatically outjected
            pmuir

            You are doing an operation on the instance of rfqRequest injected from the relevent scope - changes are made to the instance. If you did something like rfqRequest = new RfqRequest, you would need to outject that.

            • 3. Re: Conversation scoped component automatically outjected
              andreigh.ts

              Yes, it is clear to me that the modification can be seen in view because in this case @In injects the reference to the object in the context.

              I was expecting that @In to inject a copy of the object from the context... Like in the case of EVENT scope. If I use the same code, but EVENT scope, the modification is not seen in the UI.