0 Replies Latest reply on Jul 29, 2009 12:18 PM by cash1981

    Seam remote not working when using @Version

    cash1981

      I have a very weird behaviour going on. I have an entity that has a


      @Version
      public Integer getVersion() {
          return version;
      }



      And a webremote method that is executed by this javascript call:


      Seam.Component.getInstance("applicationProcessAdmin").setDisabled(id,!checked);


      However. The javascript is triggered from onclick on a checkbox. This call is never executed as long as the @Version is present. But if I remove the @Version, then suddenly it is executed. Any ideas?


      The class with webremote is this:


      @Name("applicationProcessAdmin")
      @Scope(ScopeType.EVENT)
      @AutoCreate
      public class ApplicationProcessAdmin implements Serializable {
      
           private static final long serialVersionUID = -5671816373739928344L;
           
           @In
           private EntityManager entityManager;
           
           @Transactional
           @WebRemote
           @Restrict("#{s:hasRole('sysadmin')}")
           public void setDisabled(Long id,boolean flag) {
                ApplicationProcess ap = entityManager.find(ApplicationProcess.class, id);
                if (ap != null) {
                     ap.setDisabled(flag);
                     entityManager.flush();
                }
           }
      }