Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2391 → Rev 2392

/trunk/src/org/tela_botanica/client/vues/observation/FormulaireSaisieObservationVue.java
10,6 → 10,7
 
import org.tela_botanica.client.CarnetEnLigneMediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.dao.ListeReferentielChampsEtendusDAO;
import org.tela_botanica.client.modeles.objets.ChampEtendu;
import org.tela_botanica.client.modeles.objets.Configuration;
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
321,7 → 322,7
this.setPaddings(5) ;
 
// Accesskey pour debugging
commune=new ComboBox("Commune","commune\" accesskey=\"1");
commune = new ComboBox("Commune","commune\" accesskey=\"1");
 
final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>";
commune.setTpl(resultTplCommune);
632,6 → 633,11
});
if(Configuration.saisieChampsEtendusActivee()) {
// Chargement du cache des correspondances cles/labels du catalogue
ListeReferentielChampsEtendusDAO lrceDao = new ListeReferentielChampsEtendusDAO(null);
lrceDao.obtenirGroupesChampsEtendus(this);
lrceDao.obtenirCatalogueChampsEtendus(this);
lienAjouterChampsEtendus = new HTML("Ajouter un champ étendu");
lienAjouterChampsEtendus.addStyleName("lienAjouterChampEtendu");
lienAjouterChampsEtendus.setVisible(true);
1793,6 → 1799,7
}
 
private void afficherChampsEtendus(Map<String, ChampEtendu> champsEtendus, ChampEtendu champsAFocus) {
champsEtendus = Util.trierListeChampsEtendus(champsEtendus);
viderChampsEtendus();
 
FormLayout flmd = new FormLayout();
1819,18 → 1826,29
if(champsEtendus != null && champsEtendus.size() > 0) {
lienAfficherChampsEtendus.setVisible(true);
listeChampsEtendus = new HashMap<String, ChampSaisieEtendu>(champsEtendus.size());
HashMap<String, String> correspondancesClesLabel = ListeReferentielChampsEtendusDAO.cacheClesLabels;
boolean gauche = true;
for (Iterator<String> iterator = champsEtendus.keySet().iterator(); iterator.hasNext();) {
String id = iterator.next();
ChampEtendu champ = champsEtendus.get(id);
String valeur = champ.getValeur();
String label = champ.getLabel();
String label = id;
// Si le champ possède un clé déjà définie par le catalogue, elle lui sera affectée
// sinon on la formate en la "déchamotant" et en ajoutant des espaces
if(correspondancesClesLabel.containsKey(id)) {
label = correspondancesClesLabel.get(id);
} else {
label = Util.formaterCleChampsEtenduPourAffichage(label);
}
 
ChampSaisieEtendu champTexteEtendu = new ChampSaisieEtendu(label, id);
if(champ.equals(champsAFocus)) {
champTexteEtendu.focus();
}
champTexteEtendu.setLabel(label);
champTexteEtendu.setId(id);
champTexteEtendu.setValue(valeur);
if(gauche) {
2177,7 → 2195,6
// Test idiot qui permet de savoir si l'on utilise la valeur saisie directement ou bien la valeur
// selectionnee car lors du setValue sur le keypress, gwtext ne prends pas en compte le dernier
// caractère
 
if(valeurChampBrute.trim().length() == 0) {
valeurChamp = "";
} else {