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); |