3 Replies Latest reply on Jun 4, 2009 2:22 PM by Matias Santana

    Make EntityHome subclass Statefull

    Matias  Santana Newbie

      Hi everyone!
      I will try to explain my problem.


      I´ve got a page that shows the details of a category (it was made by seam-gen).
      The problem is that every category on the system got houndreds of products, so the seam gen shows it on a very long data table.


      So to fix that i made by hand methods to manage de grid like: getNext(), getPrevious(), etc. And i put those methods on the categoryHome.
      I have to put in it a variable int who is the number of the page, but categoryHome is stateless, so i´m trying to do it statefull with scope conversation.


      I have to implement methods of the entityHome and Home classes, but i still have an exception which says:


      Caused by: java.lang.IllegalArgumentException: id to load is required for loading


      This is the interface which implements categoryHome:




      @Local
      public interface CategoryHomeRemote {
      
            public void create();
               
            public void destroy();
            
            public void queryProducts();
            
            public void setCategoryId(Integer id);
            
            public Integer getCategoryId();
            
            public Category getDefinedInstance();
            
            public void wire();
            
            public boolean isWired();
            
            public Category find();
            
            public List<CategoryDiscounts> getCategoryDiscounts();
            
            public List<SubCategories> getSubCategories();
            
            public void nextPage();
            
            public void previousPage();
            
            public boolean isNextPageAvailable();
            
            public boolean isPreviousPageAvailable();
            
            public int getPageSize();
            
            public void setPageSize(int pageSize);
            
            public void setInstance(Category instance);
            
            public Category getInstance();
            
      }
      
      



      So, i need someone who has a better idea to save that number of page, or someone who has idea where i am wrong!


      Thanx in advice guys!
      I really need this help!