I am trying to use a grid to display my data,but i got a message "Loading" instead,i am using jpaDAO,gwt-rpc.
the DTO:
Code:
@Entity@Table(name="Demande")
@NamedQueries({
	 
    @NamedQuery(name = "DemandeDTO.findall", query = "Select d from DemandeDTO d ") })
public class DemandeDTO  implements Serializable,BeanModelTag  {
	private static final long serialVersionUID = 1L;


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(unique=true, nullable=false)
	private int demandeId;


	@Column
	private String dateDemande;
	
	@Column
	private String demandeur;


	@Column
	private String typeDemande;


	@Column
	private String sujetDemande;


	@Column
	private String detaillDemande;


	@Column
	private String prioriteDemande;
	
	@Column
	private   String  service;


//getters & setters


	public DemandeDTO() {
		super();
	}


	}
The BeanModel:
Code:
public class Demande extends BaseTreeModel implements Serializable {

  


  /**
	 * 
	 */
	private static final long serialVersionUID = 1L;


public Demande() {


  }


  public int getDemandeId() {
    return (Integer) get("demandeId");
  }


  public void setDemandeId(String demandeId) {
    set("demandeId", demandeId);
  }


  public String getDateDemande() {
    return (String) get("dateDemande");
  }


  public void setDateDemande(String dateDemande) {
    set("dateDemande", dateDemande);
  }


  public String getDemandeur() {
    return (String) get("demandeur");
  }


  public void setDemandeur(String demandeur) {
    set("demandeur", demandeur);
  }


  public String getTypeDemande() {
    return (String) get("typeDemande");
  }


  public void setTypeDemande(String typeDemande) {
    set("typeDemande", typeDemande);
  }
  public String getSujetDemande() {
		return (String) get("sujetDemande");
	}


	public void setSujetDemande(String sujetDemande) {
		set("sujetDemande",sujetDemande);
	}
	
	public String getDetaillDemande() {
		 return (String) get("detaillDemande");
	}


	public void setDetaillDemande(String detaillDemande) {
		set("detaillDemande",detaillDemande);
	}
	
	public String getPrioriteDemande() {
		return  (String) get("prioriteDemande");
	}


	public void setPrioriteDemande(String prioriteDemande) {
		set("prioriteDemande",prioriteDemande);
	}
	
	public String getService() {
		return (String) get("service");
	}


	public void setService(String service) {
		set("service",service);
	}
}
TheDAO:
Code:
@SuppressWarnings("unchecked")public ArrayList<Demande> findallDemande(){
	ArrayList<Demande> list=null;
	list=(ArrayList<Demande>) EntityManagerFactory.createEntityManager().createNamedQuery("DemandeDTO.findall").getResultList();
	return list;
	
	
}
The ServiceImpl:

Code:
public PagingLoadResult<Demande> findallpaging( final  PagingLoadConfig config){		 ArrayList<Demande> demandes = DemandeDAO.findallDemande();
		
		int offset = config.getOffset();
		int limit = demandes.size();
		if (config.getLimit() > 0) {
		limit = Math.min(offset + config.getLimit(), limit);
		}
		ArrayList<Demande> sublist = new ArrayList<Demande>();
		for(int i=offset; i < limit; ++i) {
		sublist.add(demandes.get(i));
		}
		BasePagingLoadResult<Demande> result = new BasePagingLoadResult<Demande>(sublist,offset,demandes.size());
		
		return(result);
		
	}
The client:
Code:
RpcProxy<PagingLoadResult<Demande>> proxy = new RpcProxy<PagingLoadResult<Demande>>() {  		        @Override  
		        public void load(Object loadConfig, AsyncCallback<PagingLoadResult<Demande>> callback) {  
		        demandeService.findallpaging((PagingLoadConfig) loadConfig, callback);  
		        }  
		      };  
		    
		      // loader 
		      
		      final PagingLoader<PagingLoadResult<BeanModel>> loader = new BasePagingLoader<PagingLoadResult<BeanModel>>(  
		          proxy);  
		      loader.setRemoteSort(true);  
		      
		    
		      ListStore<BeanModel> store = new ListStore<BeanModel>(loader);  
		    
		      final PagingToolBar toolBar = new PagingToolBar(50);  
		      toolBar.bind(loader);
		      List<ColumnConfig> config = new ArrayList<ColumnConfig>();
		      ColumnConfig column = new ColumnConfig("demandeId", "Numero", 60);
			    config.add(column);
			    column = new ColumnConfig("dateDemande", "Date", 150);
			    config.add(column);
			    column = new ColumnConfig("demandeur", "Demandeur",200);
			    config.add(column);
			    column = new ColumnConfig("typeDemande", "Type", 100);
			    config.add(column);
			    column = new ColumnConfig("sujetDemande", "Sujet", 200);
			    config.add(column);
			    column = new ColumnConfig("detaillDemande", "Detaille", 220);
			    config.add(column);
			    column = new ColumnConfig("prioriteDemande", "Priorite", 100);
			config.add(column);
			    column = new ColumnConfig("service", "Service", 100);
			    config.add(column);
			   
			  


			    final ColumnModel cm = new ColumnModel(config);
			    
			    final Grid<BeanModel> grid = new Grid<BeanModel>(store, cm);  
			    grid.setStateId("pagingGridExample");  
			    grid.setStateful(true);  
			    grid.addListener(Events.Attach, new Listener<GridEvent<BeanModel>>() {  
			      public void handleEvent(GridEvent<BeanModel> be) {  
			        PagingLoadConfig config = new BasePagingLoadConfig();  
			        config.setOffset(0);  
			        config.setLimit(50);  
			          
			        Map<String, Object> state = grid.getState();  
			        if (state.containsKey("offset")) {  
			          int offset = (Integer)state.get("offset");  
			          int limit = (Integer)state.get("limit");  
			          config.setOffset(offset);  
			          config.setLimit(limit);  
			        }  
			       
			        loader.load(config);  
			      }  
			    });  
			    grid.setLoadMask(true);  
			    grid.setBorders(true);  
			    
			    final ContentPanel panel = new ContentPanel();
			    panel.setFrame(true);
			    panel.setVisible(false);
			    panel.setHeading("Demandes");
			    panel.setSize(1140, 433);
			    panel.setLayout(new FitLayout());
			    panel.add(grid);
How to converter the DTO to a class which extends BaseModel?