29,11 → 29,13 |
import com.extjs.gxt.ui.client.store.ListStore; |
import com.extjs.gxt.ui.client.widget.ContentPanel; |
import com.extjs.gxt.ui.client.widget.LayoutContainer; |
import com.extjs.gxt.ui.client.widget.MessageBox; |
import com.extjs.gxt.ui.client.widget.TabItem; |
import com.extjs.gxt.ui.client.widget.TabPanel; |
import com.extjs.gxt.ui.client.widget.Text; |
|
import com.extjs.gxt.ui.client.widget.button.Button; |
import com.extjs.gxt.ui.client.widget.button.IconButton; |
import com.extjs.gxt.ui.client.widget.form.ComboBox; |
import com.extjs.gxt.ui.client.widget.form.DateField; |
import com.extjs.gxt.ui.client.widget.form.FieldSet; |
44,8 → 46,11 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign; |
import com.extjs.gxt.ui.client.widget.layout.ColumnData; |
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout; |
import com.extjs.gxt.ui.client.widget.layout.FillData; |
import com.extjs.gxt.ui.client.widget.layout.FitData; |
import com.extjs.gxt.ui.client.widget.layout.FitLayout; |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout; |
import com.extjs.gxt.ui.client.widget.layout.FormData; |
import com.extjs.gxt.ui.client.widget.layout.FormLayout; |
import com.extjs.gxt.ui.client.widget.layout.TableLayout; |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem; |
159,7 → 164,9 |
private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>(); |
private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>(); |
private HashMap<String, Widget>hmInfosNat = new HashMap<String, Widget>(); |
private FormData fd100 = new FormData("1"); |
|
|
public void creerComposantsIdentite() { |
|
// Gestion de l'affichage en colonnes |
202,15 → 209,15 |
hmIdentite.put("nomComplet", nomComplet); |
|
//Préfixe |
ComboBox<Valeur> cbPrefix = new ComboBox<Valeur>(); |
ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>(); |
ListStore<Valeur> storePrefixe = new ListStore<Valeur>(); |
cbPrefix.setStore(storePrefixe); |
cbPrefix.setDisplayField("nom"); |
cbPrefix.setEmptyText("Choisissez le préfixe:"); |
cbPrefix.setFieldLabel("Prefix"); |
fsNoms.add(cbPrefix); |
cbPrefixe.setStore(storePrefixe); |
cbPrefixe.setDisplayField("nom"); |
cbPrefixe.setEmptyText("Choisissez le préfixe:"); |
cbPrefixe.setFieldLabel("Prefix"); |
fsNoms.add(cbPrefixe); |
|
hmIdentite.put("cbPrefix", cbPrefix); |
hmIdentite.put("cbPrefixe", cbPrefixe); |
|
// Remplir la liste des préfixe |
mediateur.obtenirListeValeurEtRafraichir(this, "prefixe"); |
348,8 → 355,7 |
mediateur.obtenirListeValeurEtRafraichir(this, "tel"); |
|
// Bouton ajouter |
Button bAjouter = new Button(); |
bAjouter.setText("+"); |
IconButton bAjouter = new IconButton(ComposantClass.ICONE_AJOUTER); |
|
// Evenement bouton |
bAjouter.addSelectionListener( |
359,9 → 365,9 |
|
String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue(); |
if ((strTelephone==null)||(strTelephone.trim().equals(""))) { |
Window.alert("Vous devez saisir un numéro de téléphone"); |
MessageBox.alert("Erreur de saisie", "Vous devez saisir un numéro de téléphone", null); |
} else if (hmIdentite.get("tel-" + strTelephone) != null){ |
Window.alert("Le numéro saisi est déjà présent dans la liste"); |
MessageBox.alert("Erreur de saisie", "Le numéro saisi est déjà présent dans la liste", null); |
} else { |
|
String strValeurTypeTel = ""; |
375,7 → 381,7 |
|
|
if (strValeurTypeTel.trim().equals("")) { |
Window.alert("Vous devez saisir un type de téléphone"); |
MessageBox.alert("Erreur de saisie", "Vous devez saisir un type de téléphone", null); |
} else { |
|
//Ajout d'un champ à la liste |
398,9 → 404,8 |
hmIdentite.put("tel-" + strTelephone, tTelephone); |
fsContactTel.add(tTelephone); |
|
Button bSupprimer = new Button(); |
IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER); |
bSupprimer.setId(strTelephone); |
bSupprimer.setText("-"); |
|
bSupprimer.addSelectionListener(new SelectionListener<ComponentEvent>() { |
public void componentSelected(ComponentEvent ce) { |
420,6 → 425,7 |
fsContactTel.remove(ce.component); |
|
layout(); |
|
} |
}); |
|
442,6 → 448,7 |
//Contact - autres |
FieldSet fsContact = new FieldSet(); |
fsContact.setHeading("Contact - Autres"); |
fsContact.setId("fsContact"); |
|
formLayout = new FormLayout(); |
formLayout.setLabelAlign(LabelAlign.LEFT); |
453,15 → 460,17 |
TextArea taCourriel = new TextArea(); |
taCourriel.setFieldLabel("Courriels"); |
taCourriel.setEmptyText("Saisissez les adresses courriels séparées par un saut de ligne"); |
fsContact.add(taCourriel); |
|
fsContact.add(taCourriel, fd100); |
|
hmIdentite.put("taCourriel", taCourriel); |
|
// URLS |
TextArea taUrl = new TextArea(); |
taUrl.setFieldLabel("Sites"); |
taUrl.setWidth("100%"); |
taUrl.setEmptyText("Saisissez les adresses des sites séparées par un saut de ligne"); |
fsContact.add(taUrl); |
fsContact.add(taUrl, fd100); |
|
hmIdentite.put("taUrl", taUrl); |
|
485,7 → 494,7 |
cbSexe.setDisplayField("nom"); |
cbSexe.setEmptyText("Choisissez le sexe:"); |
|
fsAutresInfos.add(cbSexe); |
fsAutresInfos.add(cbSexe, fd100); |
|
hmIdentite.put("cbSexe", cbSexe); |
|
495,7 → 504,8 |
TextArea taDescription = new TextArea(); |
taDescription.setEmptyText("Saisissez une description"); |
taDescription.setFieldLabel("Description"); |
fsAutresInfos.add(taDescription); |
taDescription.setWidth("100%"); |
fsAutresInfos.add(taDescription, fd100); |
|
hmIdentite.put("taDescription", taDescription); |
|
502,8 → 512,9 |
// Logo |
TextArea taLogo = new TextArea(); |
taLogo.setFieldLabel("Logos"); |
taLogo.setWidth("100%"); |
taLogo.setEmptyText("Saisissez les adresses des logos séparées par un saut de ligne"); |
fsAutresInfos.add(taLogo); |
fsAutresInfos.add(taLogo, fd100); |
|
hmIdentite.put("taLogo", taLogo); |
|
522,8 → 533,8 |
} |
}; |
|
cbPrefix.addSelectionChangedListener(selectionChange); |
cbPrefix.addKeyListener(klNoms); |
cbPrefixe.addSelectionChangedListener(selectionChange); |
cbPrefixe.addKeyListener(klNoms); |
tfPrenom.addKeyListener(klNoms); |
tfNom.addKeyListener(klNoms); |
cbSuffixe.addSelectionChangedListener(selectionChange); |
550,12 → 561,12 |
|
TextField<String> tfAdresse1 = new TextField(); |
tfAdresse1.setFieldLabel("Adresse"); |
left.add(tfAdresse1); |
left.add(tfAdresse1, fd100); |
hmAdresse.put("tfAdresse1", tfAdresse1); |
|
TextField<String> tfAdresse2 = new TextField(); |
tfAdresse2.setFieldLabel("Complément d'adresse"); |
left.add(tfAdresse2); |
left.add(tfAdresse2, fd100); |
hmAdresse.put("tfAdresse2", tfAdresse2); |
|
ComboBox<Valeur> cbPays = new ComboBox<Valeur>(); |
566,7 → 577,7 |
ListStore<Valeur> storePays = new ListStore<Valeur>(); |
cbPays.setStore(storePays); |
|
right.add(cbPays); |
right.add(cbPays, fd100); |
hmAdresse.put("cbPays", cbPays); |
|
SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() { |
589,23 → 600,23 |
ListStore<Valeur> storeRegion = new ListStore<Valeur>(); |
cbRegion.setStore(storeRegion); |
|
right.add(cbRegion); |
right.add(cbRegion, fd100); |
hmAdresse.put("cbRegion", cbRegion); |
|
TextField<String> tfBoitePostale = new TextField<String>(); |
tfBoitePostale.setFieldLabel("Boite postale"); |
left.add(tfBoitePostale); |
left.add(tfBoitePostale, fd100); |
hmAdresse.put("tfBoitePostale", tfBoitePostale); |
|
TextField<Integer> tfCodePostal = new TextField<Integer>(); |
tfCodePostal.setFieldLabel("Code postal"); |
right.add(tfCodePostal); |
right.add(tfCodePostal, fd100); |
hmAdresse.put("tfCodePostal", tfCodePostal); |
|
TextField tfVille = new TextField(); |
tfVille.setFieldLabel("Ville"); |
|
right.add(tfVille); |
right.add(tfVille, fd100); |
hmAdresse.put("tfVille", tfVille); |
|
// MAJ ComboBox |
697,7 → 708,7 |
|
if (listeValeurs.getId().equals(config.getListeId("prefixe"))) { |
|
remplirCombobox("cbPrefix", liste, "hmIdentite"); |
remplirCombobox("cbPrefixe", liste, "hmIdentite"); |
|
} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) { |
|
711,6 → 722,10 |
|
remplirCombobox("cbTelephone", liste, "hmIdentite"); |
|
//Préselection du tél |
ComboBox<Valeur> cbTelephone = (ComboBox<Valeur>) hmIdentite.get("cbTelephone"); |
cbTelephone.setValue(liste.get(1)); |
|
} else if (listeValeurs.getId().equals(config.getListeId("pays"))) { |
|
remplirCombobox("cbPays", liste, "hmAdresse"); |
732,6 → 747,11 |
personneSelectionnee = personne; |
|
|
//Prefix |
String prefixe = (String) personne.get("ce_truk_prefix"); |
ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe"); |
cbPrefixe.setRawValue(prefixe); |
|
((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom")); |
((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom")); |
((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre")); |
748,7 → 768,7 |
|
if (nouvellesDonnees == null) |
{ |
ComboBox cb= (ComboBox) hmIdentite.get("cbPrefix"); |
ComboBox cb= (ComboBox) hmIdentite.get("cbPrefixe"); |
|
//Met à jour le nom Complet du formulaire |
String valeurRetour = ""; |
755,12 → 775,12 |
|
// Prefixe |
String prefixe = ""; |
Valeur valPrefixe = (Valeur) ((ComboBox) hmIdentite.get("cbPrefix")).getValue(); |
Valeur valPrefixe = (Valeur) ((ComboBox) hmIdentite.get("cbPrefixe")).getValue(); |
|
if (valPrefixe != null) { |
prefixe = valPrefixe.getNom(); |
} else { |
prefixe = (String) ((ComboBox) hmIdentite.get("cbPrefix")).getRawValue(); |
prefixe = (String) ((ComboBox) hmIdentite.get("cbPrefixe")).getRawValue(); |
} |
|
|