0 Replies Latest reply on Sep 27, 2011 1:29 AM by omid pourhadi

    create dirty instance

    omid pourhadi Apprentice

      Hi,


      i created a from which has a hidden field . i set value by javascript to hidden field and send it as a parameter . when i use EntityHome persist method, everything is fine but when i use update because of i don't send request to server, seam can not realize this instance has been changed to flush changes so the update doesn't work



      child.page.xml




      <action execute="#{childHome.wire}" />
      <param name="childId" value="#{childHome.childId}" />
      <param name="parentId" value="#{parentHome.parentId}" />
      



      childHome.java



      public void wire() {
                getInstance();
                Myparent myparent = myparentHome.getDefinedInstance();
                if (myparent != null) {
                     getInstance().setMyparent(myparent);
                }
           }
      
      
      @Transactional
         public String update()
         {
            joinTransaction();
            getEntityManager().flush();
            updatedMessage();
            raiseAfterTransactionSuccessEvent();
            return "updated";
         }
      





      PS : if i call wire in update method, everything will work fine


      any advice ?