2 Replies Latest reply on Sep 23, 2010 3:39 AM by Yevgen Bushuyev

    Can a value be somehow injected into non-seam managed field?

    Yevgen Bushuyev Newbie

      Hi!


      Could you please help me to understand if it's possible (i'm newbie to seam):


      I have a bean like:




      @Name("myAction")
      @Scope(ScopeType.CONVERSATION)
      public class MyAction {
      
        private MyDTO myDto;
      
        public void setMyDto()...
        public MyDTO getMyDto()...
      
        @Create
        @Override
        public void onCreate() {
           myDto = new MyDTO(); //it needs to be created manually
           
        }
      }





      then MyDTO:




      public class MyDTO {
         private String name;
      
         public void setName...
         public String getName...
      }





      and view:



      <h:form>
          <ui:define name="label">Name:</ui:define>
          <h:inputText id="name" value="#{myAction.myDto.name}" required="true"/>
      
          <s:link value="Next" action="#{myAction.nextStep()}" />
      </h:form>





      Despite i can see that view inputs are getting filled with initial values from the myDto i can't get them propagated back to the bean on form submit (Next link). So, the question if it's possible at all, and if so then how?



      Best regards, Eugene.