92,7 → 92,7 |
private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>(); |
private HashMap<String, Widget>hmInfosNat = new HashMap<String, Widget>(); |
private HashMap<String, Valeur> hmCbSelectionnee = new HashMap(); |
private FormData fd100 = new FormData("1"); |
private FormData fd100 = new FormData("95%"); |
|
private Button enregistrer, enregistrerEtRevenir; |
|
200,8 → 200,11 |
// Gestion de l'affichage en colonnes : 3 Layout container : principal, gauche & droite |
LayoutContainer left = new LayoutContainer(); |
left.setLayout(new FormLayout()); |
left.setStyleAttribute("padding", "15px"); |
|
LayoutContainer right = new LayoutContainer(); |
right.setLayout(new FormLayout()); |
right.setStyleAttribute("padding", "15px"); |
|
LayoutContainer main = new LayoutContainer(); |
|
348,6 → 351,7 |
|
Radio rbEstDecedee = new Radio(); |
rbEstDecedee.setBoxLabel("oui"); |
rbEstDecedee.setValueAttribute("1"); |
|
rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() { |
|
356,8 → 360,13 |
((DateField) hmIdentite.get("dfDateDeces")).setVisible(true); |
((TextField) hmIdentite.get("tfLieuDeces")).setVisible(true); |
} else { |
((DateField) hmIdentite.get("dfDateDeces")).setVisible(false); |
((TextField) hmIdentite.get("tfLieuDeces")).setVisible(false); |
DateField dfDateDeces = ((DateField) hmIdentite.get("dfDateDeces")); |
dfDateDeces.setValue(null); |
dfDateDeces.setVisible(false); |
|
TextField tfLieuDeces = ((TextField) hmIdentite.get("tfLieuDeces")); |
tfLieuDeces.setValue(null); |
tfLieuDeces.setVisible(false); |
} |
} |
}); |
365,12 → 374,13 |
hmIdentite.put("rbEstDecedee", rbEstDecedee); |
|
Radio rbNestPasDecedee = new Radio(); |
rbNestPasDecedee.setValueAttribute("0"); |
rbNestPasDecedee.setBoxLabel("non"); |
rbNestPasDecedee.setValue(true); |
|
Radio rbDecesInconnu = new Radio(); |
/* Radio rbDecesInconnu = new Radio(); |
rbDecesInconnu.setBoxLabel("Ne sais pas"); |
rbDecesInconnu.setValue(true); |
rbDecesInconnu.setValue(true);*/ |
|
RadioGroup rbgDeces = new RadioGroup(); |
rbgDeces.setFieldLabel("Est décédée"); |
879,10 → 889,15 |
(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date")); |
((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu")); |
|
(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date")); |
((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu")); |
if (personne.estDecedee()) { |
(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date")); |
((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu")); |
Radio rbEstDecede = (Radio) hmIdentite.get("rbEstDecedee"); |
rbEstDecede.setValue(true); |
|
} |
|
((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone")); |
((ChampMultiValeurs) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone")); |
|
//Courriel |
((ChampMultiValeurs) hmIdentite.get("courriels")).peupler(personne.getCourriel()); |
1003,7 → 1018,6 |
personneSelectionnee = personne; |
binding.autoBind(); |
binding.bind(personneSelectionnee); |
|
layout(); |
} |
|
1085,19 → 1099,14 |
personneSelectionnee.setNaissanceDate(naissanceDate); |
|
Radio rbEstDecedee = (Radio) hmIdentite.get("rbEstDecedee"); |
if (rbEstDecedee.getValue().equals(true)) { |
|
if (rbEstDecedee.getValue() == true) { |
DateField dfDecesDate = (DateField) hmIdentite.get("dfDateDeces"); |
Date decesDate = dfDecesDate.getValue(); |
if (decesDate == null) { |
decesDate = new Date(); |
} |
personneSelectionnee.setDecesDate(decesDate); |
personneSelectionnee.set("deces_lieu", ((TextField<String>) hmIdentite.get("tfLieuDeces")).getValue()); |
String decesLieu = ((TextField<String>) hmIdentite.get("tfLieuDeces")).getValue(); |
personneSelectionnee.setDeces(dfDecesDate.getValue(), decesLieu); |
} else { |
personneSelectionnee.setNonDecedee(); |
} |
|
personneSelectionnee.setDecesDate(new Date()); |
|
strValeur = obtenirValeurCombo("cbPays"); |
personneSelectionnee.set("ce_truk_pays", strValeur); |
|
1118,6 → 1127,7 |
String specialite = ((ChampMultiValeurs) hmInfosNat.get("specialite")).getValeurs(); |
personneSelectionnee.set("ce_truk_specialite", specialite); |
|
|
if (lstMessageErreur.size() == 0) { |
mediateur.enregistrerPersonne(this, personneSelectionnee); |
success = true; |
1133,6 → 1143,8 |
success = false; |
} |
|
|
|
return success; |
} |
|
1144,12 → 1156,18 |
if (combo == null) { |
combo = (ComboBox) hmAdresse.get(strComboName); |
} |
if (combo.getValue()!=null) { |
strValeur = combo.getRawValue(); |
valeur = (Valeur) combo.getStore().findModel(strValeur); |
if (valeur != null) { |
strValeur = valeur.getId(); |
} |
|
/*if (combo.getValue()!=null) { |
valeur = (Valeur) combo.getValue(); |
strValeur = valeur.getId(); |
} else { |
strValeur = combo.getRawValue(); |
} |
}*/ |
|
return strValeur; |
} |