Subversion Repositories eFlore/Applications.coel

Rev

Rev 1417 | Rev 1468 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1417 Rev 1428
Line 1... Line 1...
1
package org.tela_botanica.client.composants.pagination;
1
package org.tela_botanica.client.composants.pagination;
Line -... Line 2...
-
 
2
 
-
 
3
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
4
import org.tela_botanica.client.modeles.Information;
-
 
5
import org.tela_botanica.client.util.Debug;
2
 
6
 
3
import com.extjs.gxt.ui.client.data.BasePagingLoader;
7
import com.extjs.gxt.ui.client.data.BasePagingLoader;
4
import com.extjs.gxt.ui.client.data.LoadEvent;
8
import com.extjs.gxt.ui.client.data.LoadEvent;
5
import com.extjs.gxt.ui.client.data.PagingLoadResult;
9
import com.extjs.gxt.ui.client.data.PagingLoadResult;
Line 6... Line 10...
6
import com.google.gwt.user.client.rpc.AsyncCallback;
10
import com.google.gwt.user.client.rpc.AsyncCallback;
Line 7... Line 11...
7
 
11
 
-
 
12
public class ChargeurListe<D extends PagingLoadResult<?>> extends BasePagingLoader<D> {
-
 
13
 
-
 
14
	private String recherche = "";
Line 8... Line 15...
8
public class ChargeurListe<D extends PagingLoadResult<?>> extends BasePagingLoader<D> {
15
	private Integer id = null;
9
 
16
	private Rafraichissable vueARafraichir = null;
10
	private String recherche = "";
17
	private boolean rafraichir = false;
-
 
18
 
11
 
19
	@SuppressWarnings("unchecked")
Line 12... Line 20...
12
	@SuppressWarnings("unchecked")
20
	public ChargeurListe(Proxy proxy, TransformateurJSONaModelData reader, Rafraichissable vueARafraichir) {
-
 
21
		super(proxy, reader);
13
	public ChargeurListe(Proxy proxy, TransformateurJSONaModelData reader) {
22
		this.vueARafraichir = vueARafraichir;
14
		super(proxy, reader);
23
	}
Line 15... Line 24...
15
	}
24
	
Line 16... Line 25...
16
	
25
	public boolean load(Object loadConfig, String recherche, boolean rafraichir) {
Line 48... Line 57...
48
	}
57
	}
Line 49... Line 58...
49
	
58
	
50
	@SuppressWarnings("unchecked")
59
	@SuppressWarnings("unchecked")
51
	protected void loadData(final Object config, String recherche) {
60
	protected void loadData(final Object config, String recherche) {
-
 
61
		AsyncCallback<D> callback = new AsyncCallback<D>() {
52
		AsyncCallback<D> callback = new AsyncCallback<D>() {
62
			
53
		    public void onFailure(Throwable caught) {
63
		    public void onFailure(Throwable caught) {
54
		      onLoadFailure(config, caught);
64
		      onLoadFailure(config, caught);
-
 
65
		    }
55
		    }
66
		    
56
		    public void onSuccess(D result) {
67
		    public void onSuccess(D result) {
-
 
68
		    	onLoadSuccess(config, result);
-
 
69
				
-
 
70
			    if (rafraichir) {				
-
 
71
			    	Information info = new Information("selectionnerValeurCombo");
-
 
72
			    	info.setDonnee(result);
-
 
73
			    	info.setMessage("");
-
 
74
					
57
		      onLoadSuccess(config, result);
75
					vueARafraichir.rafraichir(info);
-
 
76
			    }
58
		    }
77
			}
59
		};
78
		};
60
		((Proxy)proxy).load((TransformateurJSONaModelData)reader, config, callback, recherche);
79
		((Proxy)proxy).load((TransformateurJSONaModelData)reader, config, callback, recherche);
61
	}
80
	}