4 Replies Latest reply on Jul 10, 2006 2:33 AM by japplicoon

    DataModelSelection without Outjection?

    japplicoon

      My sfsb is annotated like that:

      @Stateful
      @Name("messageManager")
      @Conversational(ifNotBegunOutcome="messageBoxes")
      public class MessageManagerBean extends ListManagerBean implements MessageManager {
       ...
      }



      I have the following scenario:

      (The conversation has already begun before the page showing the list is displayed to the user).

      @Override
      @DataModel(value="msglist")
      public List getList() {
       return list;
      }
      
       @DataModelSelection(value="msglist")
       @Out(required=false) @In(required=false, create=true)
       private FMessage message;
      
      public void select(ActionEvent event) {
       message.setGelesen(true);
       message = em.merge(message);
      }
      
      


      The page displaying the message uses
      #{message}

      and everything works well.

      But if I remove
      @Out(required=false) @In(required=false, create=true)

      from the DatamodelSelection and instead use
      #{messageManager.message}

      in the message display page, something goes wrong such that I get a NullpointerException while the Facelets debug mechanism calls toString() on my message.
      Why aren't the two approaches equal?