Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1707 → Rev 1708

/trunk/src/org/tela_botanica/client/vues/structure/StructureForm.java
412,9 → 412,23
controlerFermeture();
} else if (info.getType().equals("ajout_structure")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
if (info.getDonnee(0) != null && ( info.getDonnee(0) instanceof String || info.getDonnee(0) instanceof Object) ) {
this.mode = MODE_MODIFIER;
String structureId = (String) info.getDonnee(0);
String structureId;
 
if(info.getDonnee(0) instanceof String) {
structureId = (String) info.getDonnee(0);
}
else {
// le backend renvoie un objet si longitude et latitude ont
// été générés
Structure structureMaj = (Structure)(info.getDonnee(0));
// structureMaj == null ? erreur horriblement impensable
structure.setLatitude(structureMaj.getLatitude());
structure.setLongitude(structureMaj.getLongitude());
structureId = structureMaj.getId();
}
 
structure.setId(structureId);
identification = structure;
identificationOnglet.rafraichir(info);
/trunk/src/org/tela_botanica/client/modeles/structure/StructureAsyncDao.java
160,7 → 160,17
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
// Si la requête a impliquées des valeurs autogénérées, l'objet modifié est retourné
JSONObject obj;
if ((obj = responseValue.isObject()) != null) {
if (obj.get("structures").isObject() != null) {
Information info = new Information("ajout_structure");
Structure structure = new Structure(obj.get("structures").isObject());
info.setDonnee(structure);
vueARafraichir.rafraichir(info);
}
}
else if (responseValue.isString() != null) {
Information info = new Information("ajout_structure");
String structureIdOuMessage = responseValue.isString().stringValue();
if (structureIdOuMessage.matches("^[0-9]+$")) {