1 Reply Latest reply on Mar 25, 2008 10:23 PM by barbacena

    Injection with DataModelSelection doesn't work

    andy

      Hi!


      I've got the following problem:


      I have the following Stateless Bean:


      @Stateless
      @Name("test")
      public class TestBean implements ITestBean, Serializable{
         @DataModel
         List<TestData> testList;
         
         @DataModelSelection
         @Out(required=false)
         TestData testData;
      
         @PersistenceContext
         EntityManager em;
         ..... getters and setters, @Factory method for filling 
         testList
      
         public void saveOrUpdate(){
            if(em.find(TestData.class, testData.getId()) != null){
                em.merge(testData);
            }
         }
      
      ..........
      }



      In my .xhtml file after editing the row I invoke the saveOrUpdate() method which evaluates all operations without any exceptions, but there is no any changes in database after invoking merge() function. When I debug my code I can see that testData doesn't contain the changed data in it (there is an old data before editing it). I've found some similar problem in previous topics but it didn't help me. Maybe I missed some .jar files?


      P.S. I'm using JBoss Seam 2.0.0GA and Jboss 4.2.2GA. What about .jar files I'm using jboss-seam.jar and jboss-seam-ui.jar.


      Thanks in advance,
      Andy