10,6 → 10,7 |
import org.tela_botanica.client.modeles.Information; |
import org.tela_botanica.client.modeles.structure.StructureListe; |
import org.tela_botanica.client.synchronisation.Reponse; |
import org.tela_botanica.client.util.Debug; |
import org.tela_botanica.client.util.UtilDAO; |
|
import com.extjs.gxt.ui.client.Registry; |
40,7 → 41,7 |
* est renvoyé à l'appelant |
* // FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas |
*/ |
public void selectionner(final boolean paginationProgressive, final String projetId, final String nomProjet, final int start, final int nbElements, final Integer seqId) { |
public void selectionner(final boolean paginationProgressive, final String projetId, final String nomProjet, final int start, final int nbElements, final String formatRetour, final Integer seqId) { |
|
String nom = (nomProjet == null) ? "%" : nomProjet+"%"; |
String[] param = {projetId, nom}; |
47,9 → 48,13 |
|
HashMap<String, String> restrictions = new HashMap<String, String>(); |
|
if (nbElements != -1) { |
if (nbElements != -1) { |
restrictions.put("limit", String.valueOf(nbElements)); |
} |
|
if ((formatRetour != null) && (formatRetour != "")) { |
restrictions.put("formatRetour", formatRetour); |
} |
|
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/ |
if (paginationProgressive) { |
89,7 → 94,7 |
rb.envoyerRequete(null, new JsonRestRequestCallback() { |
|
public void surReponse(JSONValue responseValue) { |
|
|
if (responseValue != null) { |
|
JSONObject responseObject = responseValue.isObject(); |
104,8 → 109,8 |
projets = new ProjetListe(reponse, responseObject.get("nbElements").isNumber(), vueARafraichir); |
projets.setTaillePage(nbElements); |
projets.setPageCourante(start); |
|
if (seqId != null) { |
|
if (seqId != null) { |
Reponse retourRequete = new Reponse(projets, seqId); |
vueARafraichir.rafraichir(retourRequete); |
} else { |
112,7 → 117,7 |
vueARafraichir.rafraichir(projets); |
} |
|
// Si la réponse est un objet, alors c'est un unique projet qui a été retournée |
// Si la réponse est un objet, alors c'est un unique projet qui a été retourné |
} else if (responseObject.get("projets").isObject() != null) { |
|
JSONObject reponse = responseObject.get("projets").isObject(); |
120,12 → 125,12 |
|
Information info = new Information("selection_projet"); |
info.setDonnee(0, projet); |
|
if (seqId != null) { |
|
if (seqId != null) { |
Reponse reponseRequete = new Reponse(info, seqId); |
vueARafraichir.rafraichir(reponseRequete); |
} |
else { |
else { |
vueARafraichir.rafraichir(info); |
} |
} |