1,5 → 1,9 |
package org.tela_botanica.client.composants.pagination; |
|
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.modeles.Information; |
import org.tela_botanica.client.util.Debug; |
|
import com.extjs.gxt.ui.client.data.BasePagingLoader; |
import com.extjs.gxt.ui.client.data.LoadEvent; |
import com.extjs.gxt.ui.client.data.PagingLoadResult; |
8,14 → 12,19 |
public class ChargeurListe<D extends PagingLoadResult<?>> extends BasePagingLoader<D> { |
|
private String recherche = ""; |
private Integer id = null; |
private Rafraichissable vueARafraichir = null; |
private boolean rafraichir = false; |
|
@SuppressWarnings("unchecked") |
public ChargeurListe(Proxy proxy, TransformateurJSONaModelData reader) { |
public ChargeurListe(Proxy proxy, TransformateurJSONaModelData reader, Rafraichissable vueARafraichir) { |
super(proxy, reader); |
this.vueARafraichir = vueARafraichir; |
} |
|
public boolean load(Object loadConfig, String recherche) { |
if (fireEvent(BeforeLoad, new LoadEvent(this, loadConfig))) { |
public boolean load(Object loadConfig, String recherche, boolean rafraichir) { |
this.rafraichir = rafraichir; |
if (fireEvent(BeforeLoad, new LoadEvent(this, loadConfig))) { |
lastConfig = loadConfig; |
|
this.recherche = recherche; |
50,12 → 59,22 |
@SuppressWarnings("unchecked") |
protected void loadData(final Object config, String recherche) { |
AsyncCallback<D> callback = new AsyncCallback<D>() { |
|
public void onFailure(Throwable caught) { |
onLoadFailure(config, caught); |
} |
|
public void onSuccess(D result) { |
onLoadSuccess(config, result); |
} |
onLoadSuccess(config, result); |
|
if (rafraichir) { |
Information info = new Information("selectionnerValeurCombo"); |
info.setDonnee(result); |
info.setMessage(""); |
|
vueARafraichir.rafraichir(info); |
} |
} |
}; |
((Proxy)proxy).load((TransformateurJSONaModelData)reader, config, callback, recherche); |
} |