4 Replies Latest reply on Oct 2, 2005 11:07 PM by Gavin King

    @DataModel

    drapierwimATgmailDOTcom Newbie

      Been playing around with seam a little bit, and must say it's 'very cool' but... I have a question.

      Is it normal that in my 'stateful sessionbean' the annotation @DataModel can only be used one single time? Ive added two this was resulting in not redendering the datatable. moving it to another bean resolves my problem.

        • 1. Re: @DataModel
          Gavin King Master

          yes, it is normal, but there is a feature request to remove that limitation

          • 2. Re: @DataModel
            drapierwimATgmailDOTcom Newbie

            This was done for a reason I guess, I'm not a design or analysis guru but I'm just wondering why there was chosen to use this approach.

            • 3. Re: @DataModel
              Jacob Hookom Newbie

               

              "drapierwim" wrote:
              This was done for a reason I guess, I'm not a design or analysis guru but I'm just wondering why there was chosen to use this approach.


              Basically it's done to avoid managing JSF-specific Objects in the testing process of your beans. Instead, you are just dealing with a List object, as returned by EJB or Hibernate, allowing Seam to expose it to JSF as a JSF DataModel.

              A lot of times developers get into the 'pick one' scenario of page flows, and the two DataModel annotations provided by Seam accomodate that common flow. Another possibility coming is actually using EL for @In, so you could do #{param.id} to manage 'pick one' requests. This isn't very JSF-ish, but a possible solution that I'm sure many will be taking advantage of.

              Cheers!

              • 4. Re: @DataModel
                Gavin King Master

                 

                "drapierwim" wrote:
                This was done for a reason I guess, I'm not a design or analysis guru but I'm just wondering why there was chosen to use this approach.


                I'm not sure if you read my post correctly. I said I plan to remove the limitation that allows just one @DataModel per component.