2 Replies Latest reply on Aug 11, 2009 3:51 PM by wilhelmtell

    DataModelSelection annotation on getter and setter

    wilhelmtell
      When I use the @DataModelSelection on the variable of the datamodel in the class it works.  I also have seen examples of working this. 

      But when I try to use this annotation on the method like

      @DataModelSelection
      @Out(required false)
      @In
      public getHouse() {
        return house;
        }

      public setHouse(House house) {
        this.house = house;
        }

      I get an error message. 
        • 1. Re: DataModelSelection annotation on getter and setter
          asookazian

          @DataModelSelection injects an object.  Don't use @In with @DataModelSelection.  You may be able to use @Out but that is somewhat suspect b/c if you outject a ListDataModel using @DataModel.



          example:


          @DataModel
          List<foo> myList;
          
          @DataModelSelection
          Foo foo;



          It should look like this every time with the exception of using java.util.Set, or Object[] instead of java.util.List.


          Read the Seam ref doc for more info.

          • 2. Re: DataModelSelection annotation on getter and setter
            wilhelmtell

            Arbi, 


            Thanks for your feedback.


            I try to understand the following sentence



            I was impressed by your perseverance talking to yourself on that thread. Thank you very much for sharing your adventures, it shortened the time it took me to fix my problem. It is just a bit sad that you had practically no help.

            I've learnt not to use @In. I will adjust my code and try if it works.