3 Replies Latest reply on Aug 4, 2006 8:56 AM by trouby

    Updating a Collection of entities

    trouby

      Hello,
      I have an EJB with a collection variable of some entities declared as:

      @In(create = false, required=false) @Out(required=false)
       private Collection<myEntity> myEntitiesList;
      



      Before using the outjected collection inside a datatable in the view, I have a previous action that initialize the collection with some content.

      I also have action method to update the collection after it gets modified by the view.

      I use this EJB for many porpuses so the collection must not be always required.


      At the moment I annotate the collection with the @IN annotation, the outjected collection outjected as an empty collection (or maybe not outjected at all, I'm not sure),

      At the moment I remove the @IN annotation, the collection is outjected with all of its content, but then, obviously the update method does not work and the collection is not affected by the view modifications.


      What am I doing wrong here?

      Thanks a lot.

        • 1. Re: Updating a Collection of entities

          some code snippets would help....

          in any case, when you outject a component that compent and it's data is always available in the seam context. hard to say what you need without the code but this is a little more typical...

          @In(required=false)
          @Out(require=false, scope=ScopeType.XXX)
          private Collection<Entity> myEntityList
          


          • 2. Re: Updating a Collection of entities
            pmuir

            Show the whole of the code of the bean. You could use a breakpoint in component to see what is being bijected.

            • 3. Re: Updating a Collection of entities
              trouby

              Hey,

              Thanks, the first reply was helpful, I usually outjected entities that were annotated to a session scope, that is why it always worked fine,

              I had to annotate the scope of the collection as session too,


              Thanks