Subversion Repositories eFlore/Applications.coel

Rev

Rev 730 | Rev 776 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 730 Rev 731
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.Collection;
4
import java.util.Collection;
5
import java.util.Date;
5
import java.util.Date;
6
import java.util.HashMap;
6
import java.util.HashMap;
7
import java.util.Iterator;
7
import java.util.Iterator;
8
import java.util.LinkedList;
8
import java.util.LinkedList;
9
import java.util.List;
9
import java.util.List;
10
 
10
 
11
import org.tela_botanica.client.ComposantClass;
11
import org.tela_botanica.client.ComposantClass;
12
import org.tela_botanica.client.Mediateur;
12
import org.tela_botanica.client.Mediateur;
13
import org.tela_botanica.client.RegistreId;
13
import org.tela_botanica.client.RegistreId;
14
import org.tela_botanica.client.composants.ChampMultiValeurs;
14
import org.tela_botanica.client.composants.ChampMultiValeurs;
15
import org.tela_botanica.client.composants.ChampMultiValeursImage;
15
import org.tela_botanica.client.composants.ChampMultiValeursImage;
16
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
16
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
17
import org.tela_botanica.client.images.Images;
17
import org.tela_botanica.client.images.Images;
18
import org.tela_botanica.client.interfaces.Rafraichissable;
18
import org.tela_botanica.client.interfaces.Rafraichissable;
19
import org.tela_botanica.client.modeles.Configuration;
19
import org.tela_botanica.client.modeles.Configuration;
20
 
20
 
21
import org.tela_botanica.client.modeles.Information;
21
import org.tela_botanica.client.modeles.Information;
22
import org.tela_botanica.client.modeles.Personne;
22
import org.tela_botanica.client.modeles.Personne;
23
import org.tela_botanica.client.modeles.PersonneListe;
23
import org.tela_botanica.client.modeles.PersonneListe;
24
import org.tela_botanica.client.modeles.Projet;
24
import org.tela_botanica.client.modeles.Projet;
25
import org.tela_botanica.client.modeles.ProjetListe;
25
import org.tela_botanica.client.modeles.ProjetListe;
26
import org.tela_botanica.client.modeles.Utilisateur;
26
import org.tela_botanica.client.modeles.Utilisateur;
27
import org.tela_botanica.client.modeles.Valeur;
27
import org.tela_botanica.client.modeles.Valeur;
28
import org.tela_botanica.client.modeles.ValeurListe;
28
import org.tela_botanica.client.modeles.ValeurListe;
29
import org.tela_botanica.client.util.Pattern;
29
import org.tela_botanica.client.util.Pattern;
30
import org.tela_botanica.client.util.UtilString;
30
import org.tela_botanica.client.util.UtilString;
31
 
31
 
32
import com.extjs.gxt.ui.client.event.Events;
32
import com.extjs.gxt.ui.client.event.Events;
33
import com.extjs.gxt.ui.client.Registry;
33
import com.extjs.gxt.ui.client.Registry;
34
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
34
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
35
import com.extjs.gxt.ui.client.Style.IconAlign;
35
import com.extjs.gxt.ui.client.Style.IconAlign;
36
import com.extjs.gxt.ui.client.Style.Scroll;
36
import com.extjs.gxt.ui.client.Style.Scroll;
37
 
37
 
38
import com.extjs.gxt.ui.client.binding.FormBinding;
38
import com.extjs.gxt.ui.client.binding.FormBinding;
39
 
39
 
40
import com.extjs.gxt.ui.client.event.ButtonEvent;
40
import com.extjs.gxt.ui.client.event.ButtonEvent;
41
import com.extjs.gxt.ui.client.event.ComponentEvent;
41
import com.extjs.gxt.ui.client.event.ComponentEvent;
42
import com.extjs.gxt.ui.client.event.KeyListener;
42
import com.extjs.gxt.ui.client.event.KeyListener;
43
import com.extjs.gxt.ui.client.event.Listener;
43
import com.extjs.gxt.ui.client.event.Listener;
44
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
44
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
45
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
45
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
46
import com.extjs.gxt.ui.client.event.SelectionListener;
46
import com.extjs.gxt.ui.client.event.SelectionListener;
47
import com.extjs.gxt.ui.client.store.ListStore;
47
import com.extjs.gxt.ui.client.store.ListStore;
48
import com.extjs.gxt.ui.client.widget.LayoutContainer;
48
import com.extjs.gxt.ui.client.widget.LayoutContainer;
49
import com.extjs.gxt.ui.client.widget.MessageBox;
49
import com.extjs.gxt.ui.client.widget.MessageBox;
50
 
50
 
51
import com.extjs.gxt.ui.client.widget.Info;
51
import com.extjs.gxt.ui.client.widget.Info;
52
import com.extjs.gxt.ui.client.widget.TabItem;
52
import com.extjs.gxt.ui.client.widget.TabItem;
53
import com.extjs.gxt.ui.client.widget.TabPanel;
53
import com.extjs.gxt.ui.client.widget.TabPanel;
54
 
54
 
55
import com.extjs.gxt.ui.client.widget.button.Button;
55
import com.extjs.gxt.ui.client.widget.button.Button;
56
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
56
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
57
import com.extjs.gxt.ui.client.widget.form.ComboBox;
57
import com.extjs.gxt.ui.client.widget.form.ComboBox;
58
import com.extjs.gxt.ui.client.widget.form.DateField;
58
import com.extjs.gxt.ui.client.widget.form.DateField;
59
import com.extjs.gxt.ui.client.widget.form.FieldSet;
59
import com.extjs.gxt.ui.client.widget.form.FieldSet;
60
import com.extjs.gxt.ui.client.widget.form.FormPanel;
60
import com.extjs.gxt.ui.client.widget.form.FormPanel;
61
import com.extjs.gxt.ui.client.widget.form.LabelField;
61
import com.extjs.gxt.ui.client.widget.form.LabelField;
62
import com.extjs.gxt.ui.client.widget.form.Radio;
62
import com.extjs.gxt.ui.client.widget.form.Radio;
63
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
63
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
64
import com.extjs.gxt.ui.client.widget.form.TextArea;
64
import com.extjs.gxt.ui.client.widget.form.TextArea;
65
import com.extjs.gxt.ui.client.widget.form.TextField;
65
import com.extjs.gxt.ui.client.widget.form.TextField;
66
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
66
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
67
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
67
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
68
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
68
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
69
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
69
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
70
import com.extjs.gxt.ui.client.widget.layout.FormData;
70
import com.extjs.gxt.ui.client.widget.layout.FormData;
71
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
71
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
72
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
72
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
73
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
73
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
74
import com.google.gwt.core.client.GWT;
74
import com.google.gwt.core.client.GWT;
75
import com.google.gwt.i18n.client.DateTimeFormat;
75
import com.google.gwt.i18n.client.DateTimeFormat;
76
import com.google.gwt.user.client.ui.Widget;
76
import com.google.gwt.user.client.ui.Widget;
77
 
77
 
78
public class PersonneForm extends FormPanel implements Rafraichissable {
78
public class PersonneForm extends FormPanel implements Rafraichissable {
79
 
79
 
80
	// VARIABLES
80
	// VARIABLES
81
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
81
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
82
	private Mediateur mediateur = Registry.get(RegistreId.MEDIATEUR);
82
	private Mediateur mediateur = Registry.get(RegistreId.MEDIATEUR);
83
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
83
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
84
	private Personne personneSelectionnee, personneSauvegarde = null;
84
	private Personne personneSelectionnee, personneSauvegarde = null;
85
	private String mode = "";
85
	private String mode = "";
86
	
86
	
87
	//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
87
	//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
88
	private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
88
	private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
89
	private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>();
89
	private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>();
90
	private HashMap<String, Widget>hmInfosNat = new HashMap<String, Widget>();
90
	private HashMap<String, Widget>hmInfosNat = new HashMap<String, Widget>();
91
	private HashMap<String, Valeur> hmCbSelectionnee = new HashMap();
91
	private HashMap<String, Valeur> hmCbSelectionnee = new HashMap();
92
	private FormData fd100 = new FormData("1");
92
	private FormData fd100 = new FormData("1");
93
	
93
	
94
	private Button enregistrer, enregistrerEtRevenir;
94
	private Button enregistrer, enregistrerEtRevenir;
95
	
95
	
96
	public static final String MODE_AJOUTER = "AJOUT";
96
	public static final String MODE_AJOUTER = "AJOUT";
97
	public static final String MODE_MODIFIER = "MODIF";
97
	public static final String MODE_MODIFIER = "MODIF";
98
 
98
 
99
	private FormBinding binding = null;
99
	private FormBinding binding = null;
100
	
100
	
101
	// CONSTRUCTEUR 
101
	// CONSTRUCTEUR 
102
	
102
	
103
	public PersonneForm(String mode) {
103
	public PersonneForm(String mode) {
104
		this.mode = mode;
104
		this.mode = mode;
105
		initialiserComposants();
105
		initialiserComposants();
106
	}
106
	}
107
	
107
	
108
	public void initialiserComposants()	{
108
	public void initialiserComposants()	{
109
		personneSelectionnee = new Personne();
109
		personneSelectionnee = new Personne();
110
		personneSauvegarde = new Personne();
110
		personneSauvegarde = new Personne();
111
		
111
		
112
		initialiserPanneau();
112
		initialiserPanneau();
113
		
113
		
114
		ButtonBar barreOutilsBas = new ButtonBar();
114
		ButtonBar barreOutilsBas = new ButtonBar();
115
		//barreOutilsBas.setButtonAlign(HorizontalAlignment.CENTER);
115
		//barreOutilsBas.setButtonAlign(HorizontalAlignment.CENTER);
116
		barreOutilsBas.setAlignment(HorizontalAlignment.CENTER);
116
		barreOutilsBas.setAlignment(HorizontalAlignment.CENTER);
117
		
117
		
118
		ajouterBoutonEnregistrer(barreOutilsBas);
118
		ajouterBoutonEnregistrer(barreOutilsBas);
119
		ajouterBoutonEnregistrerEtRevenir(barreOutilsBas);
119
		ajouterBoutonEnregistrerEtRevenir(barreOutilsBas);
120
		ajouterBoutonAnnuler(barreOutilsBas);
120
		ajouterBoutonAnnuler(barreOutilsBas);
121
		gererEtatActivationBouton();
121
		gererEtatActivationBouton();
122
		
122
		
123
		setBottomComponent(barreOutilsBas);
123
		setBottomComponent(barreOutilsBas);
124
		
124
		
125
		ToolBar barreOutilsHaut = new ToolBar();
125
		ToolBar barreOutilsHaut = new ToolBar();
126
		ajouterBoutonReinitialiser(barreOutilsHaut);
126
		ajouterBoutonReinitialiser(barreOutilsHaut);
127
		setTopComponent(barreOutilsHaut);
127
		setTopComponent(barreOutilsHaut);
128
		
128
		
129
		initialiserOnglets();	
129
		initialiserOnglets();	
130
		
130
		
131
		creerComposantsIdentite();
131
		creerComposantsIdentite();
132
		creerComposantsAdresse();
132
		creerComposantsAdresse();
133
		
133
		
134
		layout();
134
		layout();
135
		
135
		
136
		binderPersonne(personneSelectionnee);
136
		binderPersonne(personneSelectionnee);
137
	}
137
	}
138
	
138
	
139
	// SOUS-METHODES
139
	// SOUS-METHODES
140
 
140
 
141
	public void initialiserPanneau()	{
141
	public void initialiserPanneau()	{
142
		setCollapsible(false);  
142
		setCollapsible(false);  
143
		if (this.mode.equals(MODE_AJOUTER))	{
143
		if (this.mode.equals(MODE_AJOUTER))	{
144
			setHeading(mediateur.i18nC.personneModeAjout());
144
			setHeading(mediateur.i18nC.personneModeAjout());
145
			setIcon(Images.ICONES.ajouter());
145
			setIcon(Images.ICONES.ajouter());
146
		} else 	{
146
		} else 	{
147
			setHeading(mediateur.i18nC.personneModeModifier());
147
			setHeading(mediateur.i18nC.personneModeModifier());
148
			setIcon(Images.ICONES.formModifier());
148
			setIcon(Images.ICONES.formModifier());
149
		}
149
		}
150
		setButtonAlign(HorizontalAlignment.CENTER);  
150
		setButtonAlign(HorizontalAlignment.CENTER);  
151
		setLayout(new FitLayout());
151
		setLayout(new FitLayout());
152
		setBodyBorder(false);
152
		setBodyBorder(false);
153
		setBorders(false);
153
		setBorders(false);
154
		setPadding(0);
154
		setPadding(0);
155
		setWidth("100%");
155
		setWidth("100%");
156
	
156
	
157
	}
157
	}
158
	
158
	
159
	/**
159
	/**
160
	 * Crée les onglets identité, adresse et informations naturaliste
160
	 * Crée les onglets identité, adresse et informations naturaliste
161
	 * 
161
	 * 
162
	 * */
162
	 * */
163
	public void initialiserOnglets()	{
163
	public void initialiserOnglets()	{
164
		//TabPanel
164
		//TabPanel
165
		TabPanel formulaireOnglets = new TabPanel();
165
		TabPanel formulaireOnglets = new TabPanel();
166
		
166
		
167
		//Tab 1 : identite
167
		//Tab 1 : identite
168
		tiIdentite = new TabItem(mediateur.i18nC.personneIdentite());
168
		tiIdentite = new TabItem(mediateur.i18nC.personneIdentite());
169
		tiIdentite.setLayout(new FormLayout());
169
		tiIdentite.setLayout(new FormLayout());
170
		tiIdentite.setScrollMode(Scroll.AUTO);
170
		tiIdentite.setScrollMode(Scroll.AUTO);
171
		
171
		
172
		formulaireOnglets.add(tiIdentite);
172
		formulaireOnglets.add(tiIdentite);
173
		hmIdentite.put("tiIdentite", tiIdentite);
173
		hmIdentite.put("tiIdentite", tiIdentite);
174
		
174
		
175
		//Tab 2 : Adresse
175
		//Tab 2 : Adresse
176
		tiAdresses = new TabItem(mediateur.i18nC.adresse());
176
		tiAdresses = new TabItem(mediateur.i18nC.adresse());
177
		tiAdresses.setLayout(new FormLayout());
177
		tiAdresses.setLayout(new FormLayout());
178
		tiAdresses.setScrollMode(Scroll.AUTO);
178
		tiAdresses.setScrollMode(Scroll.AUTO);
179
		
179
		
180
		formulaireOnglets.add(tiAdresses);
180
		formulaireOnglets.add(tiAdresses);
181
		
181
		
182
		//Tab 3 : Infos Naturalistes
182
		//Tab 3 : Infos Naturalistes
183
		tiInfosNat = new TabItem(mediateur.i18nC.personneInfoNat());
183
		tiInfosNat = new TabItem(mediateur.i18nC.personneInfoNat());
184
		tiInfosNat.setLayout(new FormLayout());
184
		tiInfosNat.setLayout(new FormLayout());
185
		tiInfosNat.setScrollMode(Scroll.AUTO);
185
		tiInfosNat.setScrollMode(Scroll.AUTO);
186
		
186
		
187
		formulaireOnglets.add(tiInfosNat);
187
		formulaireOnglets.add(tiInfosNat);
188
		add(formulaireOnglets);
188
		add(formulaireOnglets);
189
	}
189
	}
190
	
190
	
191
	/**
191
	/**
192
	 * Crée les widgets pour l'onglet identité
192
	 * Crée les widgets pour l'onglet identité
193
	 * 
193
	 * 
194
	 * */
194
	 * */
195
	
195
	
196
	
196
	
197
	public void creerComposantsIdentite()	{
197
	public void creerComposantsIdentite()	{
198
		// Gestion de l'affichage en colonnes : 3 Layout container : principal, gauche & droite
198
		// Gestion de l'affichage en colonnes : 3 Layout container : principal, gauche & droite
199
		LayoutContainer left = new LayoutContainer();
199
		LayoutContainer left = new LayoutContainer();
200
		left.setLayout(new FormLayout());
200
		left.setLayout(new FormLayout());
201
		LayoutContainer right = new LayoutContainer();
201
		LayoutContainer right = new LayoutContainer();
202
		right.setLayout(new FormLayout());
202
		right.setLayout(new FormLayout());
203
		
203
		
204
		LayoutContainer main = new LayoutContainer();
204
		LayoutContainer main = new LayoutContainer();
205
		
205
		
206
		main.add(left, new ColumnData(.45));
206
		main.add(left, new ColumnData(.45));
207
		main.add(right, new ColumnData(.45));
207
		main.add(right, new ColumnData(.45));
208
		
208
		
209
		main.setLayout(new ColumnLayout());
209
		main.setLayout(new ColumnLayout());
210
		main.setHeight("100%");
210
		main.setHeight("100%");
211
		main.setScrollMode(Scroll.AUTO);
211
		main.setScrollMode(Scroll.AUTO);
212
		
212
		
213
		// Création des champs
213
		// Création des champs
214
		FormLayout formLayout = new FormLayout();
214
		FormLayout formLayout = new FormLayout();
215
		formLayout.setLabelAlign(LabelAlign.LEFT);
215
		formLayout.setLabelAlign(LabelAlign.LEFT);
216
		
216
		
217
		FieldSet fsProjet = new FieldSet();
217
		FieldSet fsProjet = new FieldSet();
218
		fsProjet.setHeading(mediateur.i18nC.menuProjet());
218
		fsProjet.setHeading(mediateur.i18nC.menuProjet());
219
		fsProjet.setLayout(new FormLayout());
219
		fsProjet.setLayout(new FormLayout());
220
		
220
		
221
		ListStore<Projet> storeProjets = new ListStore<Projet>();
221
		ListStore<Projet> storeProjets = new ListStore<Projet>();
222
		ComboBox cbProjets = new ComboBox<Projet>();
222
		ComboBox cbProjets = new ComboBox<Projet>();
223
		cbProjets.setFieldLabel(mediateur.i18nC.personneProjet()+ " :");
223
		cbProjets.setFieldLabel(mediateur.i18nC.personneProjet()+ " :");
224
		cbProjets.setEmptyText(mediateur.i18nC.txtListeProjetDefaut());
224
		cbProjets.setEmptyText(mediateur.i18nC.txtListeProjetDefaut());
225
		cbProjets.setLabelSeparator("");
225
		cbProjets.setLabelSeparator("");
226
		cbProjets.setDisplayField("nom");
226
		cbProjets.setDisplayField("nom");
227
		cbProjets.setEditable(false);
227
		cbProjets.setEditable(false);
228
		cbProjets.setTriggerAction(TriggerAction.ALL);
228
		cbProjets.setTriggerAction(TriggerAction.ALL);
229
		cbProjets.setStore(storeProjets);
229
		cbProjets.setStore(storeProjets);
230
		cbProjets.setAllowBlank(false);
230
		cbProjets.setAllowBlank(false);
231
		fsProjet.add(cbProjets);
231
		fsProjet.add(cbProjets);
232
		
232
		
233
		hmIdentite.put("cbProjets", cbProjets);
233
		hmIdentite.put("cbProjets", cbProjets);
234
		
234
		
235
		mediateur.selectionnerProjets(this);
235
		mediateur.selectionnerProjets(this);
236
				
236
				
237
		left.add(fsProjet);
237
		left.add(fsProjet);
238
					
238
					
239
		FieldSet fsNoms = new FieldSet();
239
		FieldSet fsNoms = new FieldSet();
240
		fsNoms.setHeading("Noms");
240
		fsNoms.setHeading("Noms");
241
		fsNoms.setLayout(formLayout); 
241
		fsNoms.setLayout(formLayout); 
242
					
242
					
243
		// Nom complet : Affiché que si valeurs saisies
243
		// Nom complet : Affiché que si valeurs saisies
244
		LabelField nomComplet = new LabelField();
244
		LabelField nomComplet = new LabelField();
245
		nomComplet.setFieldLabel(mediateur.i18nC.personneNomComplet() +" :");
245
		nomComplet.setFieldLabel(mediateur.i18nC.personneNomComplet() +" :");
246
		nomComplet.hide();
246
		nomComplet.hide();
247
				
247
				
248
		fsNoms.add(nomComplet);
248
		fsNoms.add(nomComplet);
249
		hmIdentite.put("nomComplet", nomComplet);
249
		hmIdentite.put("nomComplet", nomComplet);
250
			
250
			
251
		//Préfixe
251
		//Préfixe
252
		ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
252
		ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
253
		ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
253
		ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
254
		cbPrefixe.setStore(storePrefixe);
254
		cbPrefixe.setStore(storePrefixe);
255
		cbPrefixe.setDisplayField("nom");
255
		cbPrefixe.setDisplayField("nom");
256
		cbPrefixe.setEmptyText("Choisissez le préfixe:");
256
		cbPrefixe.setEmptyText("Choisissez le préfixe:");
257
		cbPrefixe.setFieldLabel("Prefix");
257
		cbPrefixe.setFieldLabel("Prefix");
258
		
258
		
259
		fsNoms.add(cbPrefixe);
259
		fsNoms.add(cbPrefixe);
260
		hmIdentite.put("cbPrefixe", cbPrefixe);
260
		hmIdentite.put("cbPrefixe", cbPrefixe);
261
		
261
		
262
		mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
262
		mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
263
 
263
 
264
		//Prénom
264
		//Prénom
265
		TextField<String> tfPrenom = new TextField<String>();
265
		TextField<String> tfPrenom = new TextField<String>();
266
		tfPrenom.setFieldLabel("Prénom");
266
		tfPrenom.setFieldLabel("Prénom");
267
		tfPrenom.setName("prenom");
267
		tfPrenom.setName("prenom");
268
 
268
 
269
		fsNoms.add(tfPrenom);
269
		fsNoms.add(tfPrenom);
270
		hmIdentite.put("tfPrenom", tfPrenom);
270
		hmIdentite.put("tfPrenom", tfPrenom);
271
 
271
 
272
		//Nom
272
		//Nom
273
		TextField<String> tfNom = new TextField<String>();
273
		TextField<String> tfNom = new TextField<String>();
274
		tfNom.setFieldLabel("Nom");
274
		tfNom.setFieldLabel("Nom");
275
		tfNom.setAllowBlank(false);
275
		tfNom.setAllowBlank(false);
276
		tfNom.setName("nom");
276
		tfNom.setName("nom");
277
		
277
		
278
		fsNoms.add(tfNom);
278
		fsNoms.add(tfNom);
279
		hmIdentite.put("tfNom", tfNom);
279
		hmIdentite.put("tfNom", tfNom);
280
		
280
		
281
		//Suffixe
281
		//Suffixe
282
		ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
282
		ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
283
		ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
283
		ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
284
		cbSuffixe.setStore(storeSuffixe);
284
		cbSuffixe.setStore(storeSuffixe);
285
		cbSuffixe.setFieldLabel("Suffixe");
285
		cbSuffixe.setFieldLabel("Suffixe");
286
		cbSuffixe.setDisplayField("nom");
286
		cbSuffixe.setDisplayField("nom");
287
		cbSuffixe.setEmptyText("Choisissez un suffixe:");
287
		cbSuffixe.setEmptyText("Choisissez un suffixe:");
288
		
288
		
289
		fsNoms.add(cbSuffixe);			
289
		fsNoms.add(cbSuffixe);			
290
		hmIdentite.put("cbSuffixe", cbSuffixe);
290
		hmIdentite.put("cbSuffixe", cbSuffixe);
291
		
291
		
292
		mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
292
		mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
293
 
293
 
294
		TextField<String> tfNomAutre = new TextField<String>();
294
		TextField<String> tfNomAutre = new TextField<String>();
295
		tfNomAutre.setFieldLabel("Autres noms");
295
		tfNomAutre.setFieldLabel("Autres noms");
296
		tfNomAutre.setName("truk_nom_autre");
296
		tfNomAutre.setName("truk_nom_autre");
297
		
297
		
298
		fsNoms.add(tfNomAutre);
298
		fsNoms.add(tfNomAutre);
299
		hmIdentite.put("tfNomAutre", tfNomAutre);
299
		hmIdentite.put("tfNomAutre", tfNomAutre);
300
		
300
		
301
		TextField<String> tfAbreviation = new TextField<String>();
301
		TextField<String> tfAbreviation = new TextField<String>();
302
		tfAbreviation.setFieldLabel("Abréviation");
302
		tfAbreviation.setFieldLabel("Abréviation");
303
		tfAbreviation.setName("abreviation");
303
		tfAbreviation.setName("abreviation");
304
		
304
		
305
		fsNoms.add(tfAbreviation);
305
		fsNoms.add(tfAbreviation);
306
		hmIdentite.put("tfAbreviation", tfAbreviation);
306
		hmIdentite.put("tfAbreviation", tfAbreviation);
307
 
307
 
308
		//Abréviation autres
308
		//Abréviation autres
309
		TextField<String> tfAbreviationAutre = new TextField<String>();
309
		TextField<String> tfAbreviationAutre = new TextField<String>();
310
		tfAbreviationAutre.setFieldLabel("Autres Abrév.");
310
		tfAbreviationAutre.setFieldLabel("Autres Abrév.");
311
		tfAbreviationAutre.setName("truk_abreviation_autre");
311
		tfAbreviationAutre.setName("truk_abreviation_autre");
312
		
312
		
313
		fsNoms.add(tfAbreviationAutre);
313
		fsNoms.add(tfAbreviationAutre);
314
		hmIdentite.put("tfAbreviationAutre", tfAbreviationAutre);
314
		hmIdentite.put("tfAbreviationAutre", tfAbreviationAutre);
315
										
315
										
316
		left.add(fsNoms);
316
		left.add(fsNoms);
317
		
317
		
318
		formLayout = new FormLayout();
318
		formLayout = new FormLayout();
319
		formLayout.setLabelAlign(LabelAlign.LEFT);
319
		formLayout.setLabelAlign(LabelAlign.LEFT);
320
		
320
		
321
		FieldSet fsNaissance = new FieldSet();
321
		FieldSet fsNaissance = new FieldSet();
322
		fsNaissance.setHeading("Naissance");
322
		fsNaissance.setHeading("Naissance");
323
		fsNaissance.setLayout(formLayout); 
323
		fsNaissance.setLayout(formLayout); 
324
		
324
		
325
		DateField dfDateNaissance = new DateField();
325
		DateField dfDateNaissance = new DateField();
326
		dfDateNaissance.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
326
		dfDateNaissance.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
327
		dfDateNaissance.setFieldLabel("Date");
327
		dfDateNaissance.setFieldLabel("Date");
328
		dfDateNaissance.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
328
		dfDateNaissance.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
329
		
329
		
330
		fsNaissance.add(dfDateNaissance);
330
		fsNaissance.add(dfDateNaissance);
331
		hmIdentite.put("dfDateNaissance", dfDateNaissance);
331
		hmIdentite.put("dfDateNaissance", dfDateNaissance);
332
		
332
		
333
		// Lieu naissance
333
		// Lieu naissance
334
		TextField<String> tfLieuNaissance = new TextField<String>();
334
		TextField<String> tfLieuNaissance = new TextField<String>();
335
		tfLieuNaissance.setFieldLabel("Lieu");
335
		tfLieuNaissance.setFieldLabel("Lieu");
336
		tfLieuNaissance.setName("naissance_lieu");
336
		tfLieuNaissance.setName("naissance_lieu");
337
		
337
		
338
		fsNaissance.add(tfLieuNaissance);
338
		fsNaissance.add(tfLieuNaissance);
339
		hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
339
		hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
340
			
340
			
341
		left.add(fsNaissance);
341
		left.add(fsNaissance);
342
		
342
		
343
		formLayout = new FormLayout();
343
		formLayout = new FormLayout();
344
		formLayout.setLabelAlign(LabelAlign.LEFT);
344
		formLayout.setLabelAlign(LabelAlign.LEFT);
345
		
345
		
346
		FieldSet fsDeces = new FieldSet();
346
		FieldSet fsDeces = new FieldSet();
347
		fsDeces.setHeading("Décès");
347
		fsDeces.setHeading("Décès");
348
		fsDeces.setLayout(formLayout); 
348
		fsDeces.setLayout(formLayout); 
349
			
349
			
350
		Radio rbEstDecedee = new Radio();
350
		Radio rbEstDecedee = new Radio();
351
		rbEstDecedee.setBoxLabel("oui");
351
		rbEstDecedee.setBoxLabel("oui");
352
	
352
	
353
		rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
353
		rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
354
						
354
						
355
			public void handleEvent(ComponentEvent be) {
355
			public void handleEvent(ComponentEvent be) {
356
				if(((Radio) be.getComponent()).getValue().equals(true))	{
356
				if(((Radio) be.getComponent()).getValue().equals(true))	{
357
					((DateField) hmIdentite.get("dfDateDeces")).setVisible(true);
357
					((DateField) hmIdentite.get("dfDateDeces")).setVisible(true);
358
					((TextField) hmIdentite.get("tfLieuDeces")).setVisible(true);
358
					((TextField) hmIdentite.get("tfLieuDeces")).setVisible(true);
359
				} else	{
359
				} else	{
360
					((DateField) hmIdentite.get("dfDateDeces")).setVisible(false);
360
					((DateField) hmIdentite.get("dfDateDeces")).setVisible(false);
361
					((TextField) hmIdentite.get("tfLieuDeces")).setVisible(false);
361
					((TextField) hmIdentite.get("tfLieuDeces")).setVisible(false);
362
				}
362
				}
363
			}	
363
			}	
364
		});
364
		});
365
					
365
					
366
		hmIdentite.put("rbEstDecedee", rbEstDecedee);
366
		hmIdentite.put("rbEstDecedee", rbEstDecedee);
367
		
367
		
368
		Radio rbNestPasDecedee = new Radio();
368
		Radio rbNestPasDecedee = new Radio();
369
		rbNestPasDecedee.setBoxLabel("non");
369
		rbNestPasDecedee.setBoxLabel("non");
370
		rbNestPasDecedee.setValue(true);
370
		rbNestPasDecedee.setValue(true);
371
		
371
		
372
		RadioGroup rbgDeces = new RadioGroup();
372
		RadioGroup rbgDeces = new RadioGroup();
373
		rbgDeces.setFieldLabel("Est décédée");
373
		rbgDeces.setFieldLabel("Est décédée");
374
		rbgDeces.add(rbEstDecedee);
374
		rbgDeces.add(rbEstDecedee);
375
		rbgDeces.add(rbNestPasDecedee);
375
		rbgDeces.add(rbNestPasDecedee);
376
		
376
		
377
		fsDeces.add(rbgDeces);
377
		fsDeces.add(rbgDeces);
378
		
378
		
379
		DateField dfDateDeces = new DateField();
379
		DateField dfDateDeces = new DateField();
380
		dfDateDeces.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
380
		dfDateDeces.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
381
		dfDateDeces.setFormatValue(true);
381
		dfDateDeces.setFormatValue(true);
382
		dfDateDeces.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
382
		dfDateDeces.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
383
		dfDateDeces.setFieldLabel("Date");
383
		dfDateDeces.setFieldLabel("Date");
384
		dfDateDeces.setVisible(false);
384
		dfDateDeces.setVisible(false);
385
 
385
 
386
		fsDeces.add(dfDateDeces);
386
		fsDeces.add(dfDateDeces);
387
		hmIdentite.put("dfDateDeces", dfDateDeces);
387
		hmIdentite.put("dfDateDeces", dfDateDeces);
388
 
388
 
389
		TextField<String> tfLieuDeces = new TextField<String>();
389
		TextField<String> tfLieuDeces = new TextField<String>();
390
		tfLieuDeces.setFieldLabel("Lieu");
390
		tfLieuDeces.setFieldLabel("Lieu");
391
		tfLieuDeces.setName("deces_lieu");
391
		tfLieuDeces.setName("deces_lieu");
392
		tfLieuDeces.setVisible(false);
392
		tfLieuDeces.setVisible(false);
393
		
393
		
394
		fsDeces.add(tfLieuDeces);
394
		fsDeces.add(tfLieuDeces);
395
		hmIdentite.put("tfLieuDeces", tfLieuDeces);
395
		hmIdentite.put("tfLieuDeces", tfLieuDeces);
396
								
396
								
397
		left.add(fsDeces);
397
		left.add(fsDeces);
398
			
398
			
399
		tiIdentite.add(main);
399
		tiIdentite.add(main);
400
			
400
			
401
		FieldSet fsContactTel = new FieldSet();
401
		FieldSet fsContactTel = new FieldSet();
402
		fsContactTel.setHeading("Contact - Téléphones");
402
		fsContactTel.setHeading("Contact - Téléphones");
403
		fsContactTel.setLayout(new RowLayout());
403
		fsContactTel.setLayout(new RowLayout());
404
		
404
		
405
		
405
		
406
		ChampMultiValeursMultiTypes telephones = new ChampMultiValeursMultiTypes("Téléphones");
406
		ChampMultiValeursMultiTypes telephones = new ChampMultiValeursMultiTypes("Téléphones");
407
		hmIdentite.put("telephones", telephones);
407
		hmIdentite.put("telephones", telephones);
408
		telephones.initialiserType("tel", mediateur);
408
		telephones.initialiserType("tel", mediateur);
409
		fsContactTel.add(telephones);
409
		fsContactTel.add(telephones);
410
		right.add(fsContactTel);
410
		right.add(fsContactTel);
411
		hmIdentite.put("fsContactTel", fsContactTel);
411
		hmIdentite.put("fsContactTel", fsContactTel);
412
				
412
				
413
		
413
		
414
		FieldSet fsContact = new FieldSet();
414
		FieldSet fsContact = new FieldSet();
415
		fsContact.setHeading("Contact - Autres");
415
		fsContact.setHeading("Contact - Autres");
416
		fsContact.setId("fsContact");
416
		fsContact.setId("fsContact");
417
		fsContact.setLayout(new RowLayout());
417
		fsContact.setLayout(new RowLayout());
418
 
418
 
419
		right.add(fsContact);
419
		right.add(fsContact);
420
		hmIdentite.put("fsContact", fsContact);
420
		hmIdentite.put("fsContact", fsContact);
421
 
421
 
422
		ChampMultiValeurs courriels = new ChampMultiValeurs("Courriels");
422
		ChampMultiValeurs courriels = new ChampMultiValeurs("Courriels");
423
		courriels.setValidation(Pattern.email, "moi@domaine.fr");
423
		courriels.setValidation(Pattern.email, "moi@domaine.fr");
424
		fsContact.add(courriels);
424
		fsContact.add(courriels);
425
		hmIdentite.put("courriels", courriels);
425
		hmIdentite.put("courriels", courriels);
426
		
426
		
427
		LayoutContainer lcCourrielContainer = new LayoutContainer(new RowLayout());
427
		LayoutContainer lcCourrielContainer = new LayoutContainer(new RowLayout());
428
		
428
		
429
		fsContact.add(lcCourrielContainer);
429
		fsContact.add(lcCourrielContainer);
430
		hmIdentite.put("lcCourrielContainer", lcCourrielContainer);
430
		hmIdentite.put("lcCourrielContainer", lcCourrielContainer);
431
 
431
 
432
		ChampMultiValeurs sites = new ChampMultiValeurs("Sites web");
432
		ChampMultiValeurs sites = new ChampMultiValeurs("Sites web");
433
		sites.setValeurParDefaut("http://");
433
		sites.setValeurParDefaut("http://");
434
		sites.setValidation(Pattern.url, "http://www.monsite.com");
434
		sites.setValidation(Pattern.url, "http://www.monsite.com");
435
		fsContact.add(sites);
435
		fsContact.add(sites);
436
		hmIdentite.put("sites", sites);
436
		hmIdentite.put("sites", sites);
437
			
437
			
438
		FieldSet fsAutresInfos = new FieldSet();
438
		FieldSet fsAutresInfos = new FieldSet();
439
		fsAutresInfos.setHeading("Autres informations");
439
		fsAutresInfos.setHeading("Autres informations");
440
	
440
	
441
		formLayout = new FormLayout();
441
		formLayout = new FormLayout();
442
		formLayout.setLabelAlign(LabelAlign.LEFT);
442
		formLayout.setLabelAlign(LabelAlign.LEFT);
443
		fsAutresInfos.setLayout(formLayout); 
443
		fsAutresInfos.setLayout(formLayout); 
444
			
444
			
445
				
445
				
446
		formLayout = new FormLayout();
446
		formLayout = new FormLayout();
447
		formLayout.setLabelAlign(LabelAlign.TOP);
447
		formLayout.setLabelAlign(LabelAlign.TOP);
448
		LayoutContainer lcAutreInformations1 = new LayoutContainer(formLayout);
448
		LayoutContainer lcAutreInformations1 = new LayoutContainer(formLayout);
449
							
449
							
450
		//Civilité				
450
		//Civilité				
451
		ListStore<Valeur> storeSexe = new ListStore<Valeur>();
451
		ListStore<Valeur> storeSexe = new ListStore<Valeur>();
452
		ComboBox<Valeur> cbSexe = new ComboBox<Valeur>();
452
		ComboBox<Valeur> cbSexe = new ComboBox<Valeur>();
453
		cbSexe.setStore(storeSexe);
453
		cbSexe.setStore(storeSexe);
454
		cbSexe.setFieldLabel("Sexe");
454
		cbSexe.setFieldLabel("Sexe");
455
		cbSexe.setDisplayField("nom");
455
		cbSexe.setDisplayField("nom");
456
		cbSexe.setEmptyText("Choisissez le sexe:");
456
		cbSexe.setEmptyText("Choisissez le sexe:");
457
	
457
	
458
		lcAutreInformations1.add(cbSexe, fd100);			
458
		lcAutreInformations1.add(cbSexe, fd100);			
459
		hmIdentite.put("cbSexe", cbSexe);
459
		hmIdentite.put("cbSexe", cbSexe);
460
	
460
	
461
		mediateur.obtenirListeValeurEtRafraichir(this, "sexe");			
461
		mediateur.obtenirListeValeurEtRafraichir(this, "sexe");			
462
		
462
		
463
		//Description
463
		//Description
464
		TextArea taDescription = new TextArea();
464
		TextArea taDescription = new TextArea();
465
		taDescription.setEmptyText("Saisissez une description");
465
		taDescription.setEmptyText("Saisissez une description");
466
		taDescription.setFieldLabel("Description");
466
		taDescription.setFieldLabel("Description");
467
		taDescription.setWidth("100%");
467
		taDescription.setWidth("100%");
468
		taDescription.setName("description");
468
		taDescription.setName("description");
469
		
469
		
470
		lcAutreInformations1.add(taDescription, fd100);
470
		lcAutreInformations1.add(taDescription, fd100);
471
		hmIdentite.put("taDescription", taDescription);
471
		hmIdentite.put("taDescription", taDescription);
472
		
472
		
473
		fsAutresInfos.add(lcAutreInformations1);
473
		fsAutresInfos.add(lcAutreInformations1);
474
		
474
		
475
		// Logo
475
		// Logo
476
		LayoutContainer lcLogoUrl = new LayoutContainer();
476
		LayoutContainer lcLogoUrl = new LayoutContainer();
477
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
477
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
478
		
478
		
479
		ChampMultiValeursImage logo = new ChampMultiValeursImage("Logos");
479
		ChampMultiValeursImage logo = new ChampMultiValeursImage("Logos");
480
		logo.setImageHeight("150px");
480
		logo.setImageHeight("150px");
481
		logo.setValeurParDefaut("http://");
481
		logo.setValeurParDefaut("http://");
482
		logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
482
		logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
483
		logo.setValeurBoutonSupprimer("Supprimer");
483
		logo.setValeurBoutonSupprimer("Supprimer");
484
		hmIdentite.put("logos", logo);
484
		hmIdentite.put("logos", logo);
485
		
485
		
486
		lcLogoUrl.add(logo);
486
		lcLogoUrl.add(logo);
487
		
487
		
488
		fsAutresInfos.add(logo);
488
		fsAutresInfos.add(logo);
489
		
489
		
490
		LayoutContainer lcAutreInformations2 = new LayoutContainer(new ColumnLayout());
490
		LayoutContainer lcAutreInformations2 = new LayoutContainer(new ColumnLayout());
491
		hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
491
		hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
492
		fsAutresInfos.add(lcAutreInformations2);
492
		fsAutresInfos.add(lcAutreInformations2);
493
			
493
			
494
		right.add(fsAutresInfos);
494
		right.add(fsAutresInfos);
495
			
495
			
496
		// Ajout des évènements saisi
496
		// Ajout des évènements saisi
497
		KeyListener klNoms = new KeyListener()	{
497
		KeyListener klNoms = new KeyListener()	{
498
			public void componentKeyUp(ComponentEvent ev)	{
498
			public void componentKeyUp(ComponentEvent ev)	{
499
				rafraichir(null);	
499
				rafraichir(null);	
500
			}				
500
			}				
501
		};
501
		};
502
		
502
		
503
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
503
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
504
			public void selectionChanged(SelectionChangedEvent se) {
504
			public void selectionChanged(SelectionChangedEvent se) {
505
				rafraichir(null);
505
				rafraichir(null);
506
			}
506
			}
507
		};
507
		};
508
						
508
						
509
		cbPrefixe.addSelectionChangedListener(selectionChange);
509
		cbPrefixe.addSelectionChangedListener(selectionChange);
510
		cbPrefixe.addKeyListener(klNoms);
510
		cbPrefixe.addKeyListener(klNoms);
511
		tfPrenom.addKeyListener(klNoms);
511
		tfPrenom.addKeyListener(klNoms);
512
		tfNom.addKeyListener(klNoms);
512
		tfNom.addKeyListener(klNoms);
513
		cbSuffixe.addSelectionChangedListener(selectionChange);		
513
		cbSuffixe.addSelectionChangedListener(selectionChange);		
514
			
514
			
515
	}
515
	}
516
	
516
	
517
	public void creerComposantsAdresse()	{
517
	public void creerComposantsAdresse()	{
518
		// Gauche
518
		// Gauche
519
		LayoutContainer left = new LayoutContainer();
519
		LayoutContainer left = new LayoutContainer();
520
		left.setLayout(new FormLayout());
520
		left.setLayout(new FormLayout());
521
		
521
		
522
		// Droite
522
		// Droite
523
		LayoutContainer right = new LayoutContainer();
523
		LayoutContainer right = new LayoutContainer();
524
		right.setLayout(new FormLayout());
524
		right.setLayout(new FormLayout());
525
		
525
		
526
		// Principal
526
		// Principal
527
		LayoutContainer main = new LayoutContainer();
527
		LayoutContainer main = new LayoutContainer();
528
		main.setLayout(new ColumnLayout());
528
		main.setLayout(new ColumnLayout());
529
		
529
		
530
		// Ajout au principal
530
		// Ajout au principal
531
		main.add(left, new ColumnData(.49));
531
		main.add(left, new ColumnData(.49));
532
		main.add(right, new ColumnData(.49));	
532
		main.add(right, new ColumnData(.49));	
533
		
533
		
534
		TextField<String> tfAdresse1 = new TextField();
534
		TextField<String> tfAdresse1 = new TextField();
535
		tfAdresse1.setFieldLabel("Adresse");
535
		tfAdresse1.setFieldLabel("Adresse");
536
		tfAdresse1.setName("adresse_01");
536
		tfAdresse1.setName("adresse_01");
537
		left.add(tfAdresse1, fd100);
537
		left.add(tfAdresse1, fd100);
538
		hmAdresse.put("tfAdresse1", tfAdresse1);
538
		hmAdresse.put("tfAdresse1", tfAdresse1);
539
		
539
		
540
		TextField<String> tfAdresse2 = new TextField();
540
		TextField<String> tfAdresse2 = new TextField();
541
		tfAdresse2.setFieldLabel("Complément d'adresse");
541
		tfAdresse2.setFieldLabel("Complément d'adresse");
542
		tfAdresse2.setName("adresse_02");
542
		tfAdresse2.setName("adresse_02");
543
		left.add(tfAdresse2, fd100);
543
		left.add(tfAdresse2, fd100);
544
		hmAdresse.put("tfAdresse2", tfAdresse2);
544
		hmAdresse.put("tfAdresse2", tfAdresse2);
545
		
545
		
546
		ComboBox<Valeur> cbPays = new ComboBox<Valeur>();
546
		ComboBox<Valeur> cbPays = new ComboBox<Valeur>();
547
		cbPays.setFieldLabel("Pays");
547
		cbPays.setFieldLabel("Pays");
548
		cbPays.setDisplayField("nom");
548
		cbPays.setDisplayField("nom");
549
		cbPays.setEmptyText("Sélectionnez le pays:");
549
		cbPays.setEmptyText("Sélectionnez le pays:");
550
		
550
		
551
		ListStore<Valeur> storePays = new ListStore<Valeur>();
551
		ListStore<Valeur> storePays = new ListStore<Valeur>();
552
		cbPays.setStore(storePays);
552
		cbPays.setStore(storePays);
553
		
553
		
554
		right.add(cbPays, fd100);
554
		right.add(cbPays, fd100);
555
		hmAdresse.put("cbPays", cbPays);
555
		hmAdresse.put("cbPays", cbPays);
556
		
556
		
557
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
557
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
558
			public void selectionChanged(SelectionChangedEvent se) {
558
			public void selectionChanged(SelectionChangedEvent se) {
559
				// Rafraichir avec le pays sélectionné
559
				// Rafraichir avec le pays sélectionné
560
				obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
560
				obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
561
			}
561
			}
562
		};
562
		};
563
					
563
					
564
		cbPays.addSelectionChangedListener(selectionChange);
564
		cbPays.addSelectionChangedListener(selectionChange);
565
		
565
		
566
		
566
		
567
		ComboBox<Valeur> cbRegion = new ComboBox<Valeur>();
567
		ComboBox<Valeur> cbRegion = new ComboBox<Valeur>();
568
		cbRegion.setFieldLabel("Region");
568
		cbRegion.setFieldLabel("Region");
569
		cbRegion.setDisplayField("nom");
569
		cbRegion.setDisplayField("nom");
570
		cbRegion.setEmptyText("Sélectionnez la région:");
570
		cbRegion.setEmptyText("Sélectionnez la région:");
571
		cbRegion.setVisible(false);
571
		cbRegion.setVisible(false);
572
		
572
		
573
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
573
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
574
		cbRegion.setStore(storeRegion);
574
		cbRegion.setStore(storeRegion);
575
		
575
		
576
		
576
		
577
		right.add(cbRegion, fd100);
577
		right.add(cbRegion, fd100);
578
		hmAdresse.put("cbRegion", cbRegion);
578
		hmAdresse.put("cbRegion", cbRegion);
579
		
579
		
580
		TextField<String> tfBoitePostale = new TextField<String>();
580
		TextField<String> tfBoitePostale = new TextField<String>();
581
		tfBoitePostale.setFieldLabel("Boite postale");
581
		tfBoitePostale.setFieldLabel("Boite postale");
582
		tfBoitePostale.setName("bp");
582
		tfBoitePostale.setName("bp");
583
		
583
		
584
		left.add(tfBoitePostale, fd100);
584
		left.add(tfBoitePostale, fd100);
585
		hmAdresse.put("tfBoitePostale", tfBoitePostale);
585
		hmAdresse.put("tfBoitePostale", tfBoitePostale);
586
		
586
		
587
		TextField<Integer> tfCodePostal = new TextField<Integer>();
587
		TextField<Integer> tfCodePostal = new TextField<Integer>();
588
		tfCodePostal.setFieldLabel("Code postal");
588
		tfCodePostal.setFieldLabel("Code postal");
589
		tfCodePostal.setName("code_postal");
589
		tfCodePostal.setName("code_postal");
590
		
590
		
591
		right.add(tfCodePostal, fd100);
591
		right.add(tfCodePostal, fd100);
592
		hmAdresse.put("tfCodePostal", tfCodePostal);
592
		hmAdresse.put("tfCodePostal", tfCodePostal);
593
		
593
		
594
		TextField tfVille = new TextField();
594
		TextField tfVille = new TextField();
595
		tfVille.setFieldLabel("Ville");
595
		tfVille.setFieldLabel("Ville");
596
		tfVille.setName("ville");
596
		tfVille.setName("ville");
597
		
597
		
598
		right.add(tfVille, fd100);
598
		right.add(tfVille, fd100);
599
		hmAdresse.put("tfVille", tfVille);
599
		hmAdresse.put("tfVille", tfVille);
600
		
600
		
601
		// MAJ ComboBox
601
		// MAJ ComboBox
602
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
602
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
603
		
603
		
604
		FieldSet fsAdresse = new FieldSet();
604
		FieldSet fsAdresse = new FieldSet();
605
		fsAdresse.setHeading("Adresse personnelle");
605
		fsAdresse.setHeading("Adresse personnelle");
606
		fsAdresse.add(main);
606
		fsAdresse.add(main);
607
		
607
		
608
		tiAdresses.add(fsAdresse);
608
		tiAdresses.add(fsAdresse);
609
		((ComboBox) hmIdentite.get("cbPrefixe")).setRawValue("ljkhlkj");
609
		((ComboBox) hmIdentite.get("cbPrefixe")).setRawValue("ljkhlkj");
610
	}
610
	}
611
		
611
		
612
	/**
612
	/**
613
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
613
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
614
	 * 
614
	 * 
615
	 * @param barreOutils la barre d'outils à modifier
615
	 * @param barreOutils la barre d'outils à modifier
616
	 * */
616
	 * */
617
	public void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
617
	public void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
618
		
618
		
619
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
619
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
620
		Button reinitialiser = new Button("Réinitialiser le formulaire");
620
		Button reinitialiser = new Button("Réinitialiser le formulaire");
621
		reinitialiser.setIcon(Images.ICONES.rafraichir());
621
		reinitialiser.setIcon(Images.ICONES.rafraichir());
622
		reinitialiser.addSelectionListener(new SelectionListener<ButtonEvent>() {  
622
		reinitialiser.addSelectionListener(new SelectionListener<ButtonEvent>() {  
623
			public void componentSelected(ButtonEvent ce) {  
623
			public void componentSelected(ButtonEvent ce) {  
624
				//((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
624
				//((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
625
				reinitialiser();
625
				reinitialiser();
626
			}  
626
			}  
627
		});
627
		});
628
		barreOutils.add(reinitialiser);
628
		barreOutils.add(reinitialiser);
629
	}
629
	}
630
	
630
	
631
	/**
631
	/**
632
	 * Ajouter le bouton Sauvegarder et revenir à la liste à la barre d'outils donnée
632
	 * Ajouter le bouton Sauvegarder et revenir à la liste à la barre d'outils donnée
633
	 * 
633
	 * 
634
	 * @param barreOutils la barre d'outils à modifier
634
	 * @param barreOutils la barre d'outils à modifier
635
	 * */
635
	 * */
636
	private void ajouterBoutonEnregistrerEtRevenir(ButtonBar barreOutils)	{
636
	private void ajouterBoutonEnregistrerEtRevenir(ButtonBar barreOutils)	{
637
		
637
		
638
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
638
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
639
		enregistrerEtRevenir = new Button("Enregistrer et revenir à la liste");
639
		enregistrerEtRevenir = new Button("Enregistrer et revenir à la liste");
640
		enregistrerEtRevenir.setIcon(Images.ICONES.scriptGo());
640
		enregistrerEtRevenir.setIcon(Images.ICONES.scriptGo());
641
		enregistrerEtRevenir.setIconAlign(IconAlign.LEFT);
641
		enregistrerEtRevenir.setIconAlign(IconAlign.LEFT);
642
		enregistrerEtRevenir.addSelectionListener(new SelectionListener<ButtonEvent>() {  
642
		enregistrerEtRevenir.addSelectionListener(new SelectionListener<ButtonEvent>() {  
643
			public void componentSelected(ButtonEvent ce) {  
643
			public void componentSelected(ButtonEvent ce) {  
644
				if (enregistrer() == true)	{
644
				if (enregistrer() == true)	{
645
					((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
645
					((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
646
				}
646
				}
647
			}  
647
			}  
648
		});
648
		});
649
		
649
		
650
		hmIdentite.put("btnEnregistrerRevenir", enregistrerEtRevenir);
650
		hmIdentite.put("btnEnregistrerRevenir", enregistrerEtRevenir);
651
		barreOutils.add(enregistrerEtRevenir);
651
		barreOutils.add(enregistrerEtRevenir);
652
		enregistrerEtRevenir.setEnabled(false);
652
		enregistrerEtRevenir.setEnabled(false);
653
		
653
		
654
	}
654
	}
655
	
655
	
656
	/**
656
	/**
657
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
657
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
658
	 * 
658
	 * 
659
	 * @param barreOutils la barre d'outils à modifier
659
	 * @param barreOutils la barre d'outils à modifier
660
	 * */
660
	 * */
661
	private void ajouterBoutonEnregistrer(ButtonBar barreOutils)	{
661
	private void ajouterBoutonEnregistrer(ButtonBar barreOutils)	{
662
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
662
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
663
		enregistrer = new Button("Enregistrer");
663
		enregistrer = new Button("Enregistrer");
664
		enregistrer.setIcon(Images.ICONES.scriptSave());
664
		enregistrer.setIcon(Images.ICONES.scriptSave());
665
		enregistrer.setIconAlign(IconAlign.LEFT);
665
		enregistrer.setIconAlign(IconAlign.LEFT);
666
		enregistrer.setId("main-button");
666
		enregistrer.setId("main-button");
667
		enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {  
667
		enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {  
668
			public void componentSelected(ButtonEvent ce) {  
668
			public void componentSelected(ButtonEvent ce) {  
669
				enregistrer();
669
				enregistrer();
670
			}  
670
			}  
671
		});
671
		});
672
		enregistrer.setEnabled(false);
672
		enregistrer.setEnabled(false);
673
		hmIdentite.put("btnEnregistrer", enregistrer);
673
		hmIdentite.put("btnEnregistrer", enregistrer);
674
		barreOutils.add(enregistrer);
674
		barreOutils.add(enregistrer);
675
	}
675
	}
676
	
676
	
677
	/**
677
	/**
678
	 * Ajouter le bouton annuler à la barre d'outils donnée
678
	 * Ajouter le bouton annuler à la barre d'outils donnée
679
	 * 
679
	 * 
680
	 * @param barreOutils la barre d'outils à modifier
680
	 * @param barreOutils la barre d'outils à modifier
681
	 * */
681
	 * */
682
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
682
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
683
		
683
		
684
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
684
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
685
		Button annuler = new Button("Revenir à la liste");
685
		Button annuler = new Button("Revenir à la liste");
686
		annuler.addSelectionListener(new SelectionListener<ButtonEvent>() {  
686
		annuler.addSelectionListener(new SelectionListener<ButtonEvent>() {  
687
			public void componentSelected(ButtonEvent ce) {  
687
			public void componentSelected(ButtonEvent ce) {  
688
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
688
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
689
			}  
689
			}  
690
		});
690
		});
691
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
691
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
692
		barreOutils.add(annuler);
692
		barreOutils.add(annuler);
693
	}
693
	}
694
	
694
	
695
	public void obtenirListeRegionParPays(String strPays)	{
695
	public void obtenirListeRegionParPays(String strPays)	{
696
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
696
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
697
	}
697
	}
698
	
698
	
699
	// RAFRAICHISSEMENT DU PANNEAU
699
	// RAFRAICHISSEMENT DU PANNEAU
700
 
700
 
701
	public void rafraichir(Object nouvellesDonnees) {
701
	public void rafraichir(Object nouvellesDonnees) {
702
		if (nouvellesDonnees instanceof ValeurListe) {
702
		if (nouvellesDonnees instanceof ValeurListe) {
703
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
703
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
704
			
704
			
705
			// Créer une liste de valeurs
705
			// Créer une liste de valeurs
706
			List<Valeur> liste = new ArrayList<Valeur>();
706
			List<Valeur> liste = new ArrayList<Valeur>();
707
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
707
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
708
				liste.add(listeValeurs.get(it.next()));
708
				liste.add(listeValeurs.get(it.next()));
709
			}
709
			}
710
			
710
			
711
			if (listeValeurs.getId().equals(config.getListeId("prefixe")))	{
711
			if (listeValeurs.getId().equals(config.getListeId("prefixe")))	{
712
				remplirCombobox("cbPrefixe", liste, "hmIdentite");
712
				remplirCombobox("cbPrefixe", liste, "hmIdentite");
713
			} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) {
713
			} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) {
714
				remplirCombobox("cbSuffixe", liste, "hmIdentite");
714
				remplirCombobox("cbSuffixe", liste, "hmIdentite");
715
			} else if (listeValeurs.getId().equals(config.getListeId("sexe"))) {
715
			} else if (listeValeurs.getId().equals(config.getListeId("sexe"))) {
716
				remplirCombobox("cbSexe", liste, "hmIdentite");
716
				remplirCombobox("cbSexe", liste, "hmIdentite");
717
			} else if (listeValeurs.getId().equals(config.getListeId("tel"))) {
717
			} else if (listeValeurs.getId().equals(config.getListeId("tel"))) {
718
				remplirCombobox("cbTelephone", liste, "hmIdentite");
718
				remplirCombobox("cbTelephone", liste, "hmIdentite");
719
 
719
 
720
				//Préselection du tél
720
				//Préselection du tél
721
				ComboBox<Valeur> cbTelephone = (ComboBox<Valeur>) hmIdentite.get("cbTelephone");
721
				ComboBox<Valeur> cbTelephone = (ComboBox<Valeur>) hmIdentite.get("cbTelephone");
722
				cbTelephone.setValue(liste.get(1));
722
				cbTelephone.setValue(liste.get(1));
723
			} else if (listeValeurs.getId().equals(config.getListeId("pays")))	{
723
			} else if (listeValeurs.getId().equals(config.getListeId("pays")))	{
724
				remplirCombobox("cbPays", liste, "hmAdresse");
724
				remplirCombobox("cbPays", liste, "hmAdresse");
725
			} else if (listeValeurs.getId().equals(config.getListeId("region")))	{
725
			} else if (listeValeurs.getId().equals(config.getListeId("region")))	{
726
				remplirCombobox("cbRegion", liste, "hmAdresse");
726
				remplirCombobox("cbRegion", liste, "hmAdresse");
727
				((ComboBox<Valeur>) hmAdresse.get("cbRegion")).setVisible(true);
727
				((ComboBox) hmAdresse.get("cbRegion")).setVisible(true);
728
			}
728
			}
729
		} else if (nouvellesDonnees instanceof ProjetListe) {
729
		} else if (nouvellesDonnees instanceof ProjetListe) {
730
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
730
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
731
			List<Projet> liste = projets.toList();
731
			List<Projet> liste = projets.toList();
732
			
732
			
733
			ComboBox<Projet> cbProjets = (ComboBox<Projet>) hmIdentite.get("cbProjets");
733
			ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
734
			ListStore<Projet> storeProjets= cbProjets.getStore();
734
			ListStore<Projet> storeProjets= cbProjets.getStore();
735
			storeProjets.removeAll();
735
			storeProjets.removeAll();
736
			storeProjets.add(liste);
736
			storeProjets.add(liste);
737
			cbProjets.setStore(storeProjets);
737
			cbProjets.setStore(storeProjets);
738
		} else if (nouvellesDonnees instanceof Information)	{
738
		} else if (nouvellesDonnees instanceof Information)	{
739
			Information info = (Information) nouvellesDonnees;
739
			Information info = (Information) nouvellesDonnees;
740
			if (info.getType().equals("ajout_personne"))	{
740
			if (info.getType().equals("ajout_personne"))	{
741
				GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null);
741
				GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null);
742
				Info.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")");
742
				Info.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")");
743
			} else if (info.getType().equals("modification_personne"))	{
743
			} else if (info.getType().equals("modification_personne"))	{
744
				Info.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
744
				Info.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
745
			}
745
			}
746
			else if (info.getType().equals("maj_utilisateur"))	{
746
			else if (info.getType().equals("maj_utilisateur"))	{
747
				gererEtatActivationBouton();
747
				gererEtatActivationBouton();
748
			} else if (info.getDonnee(0) instanceof PersonneListe)	{
748
			} else if (info.getDonnee(0) instanceof PersonneListe)	{
749
				Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
749
				Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
750
				Iterator itPersonneListe = colPersonneListe.iterator();
750
				Iterator itPersonneListe = colPersonneListe.iterator();
751
				Personne personne = (Personne) itPersonneListe.next();
751
				Personne personne = (Personne) itPersonneListe.next();
752
				
752
				
753
				personneSauvegarde = new Personne();
753
				personneSauvegarde = new Personne();
754
				personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
754
				personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
755
				
755
				
756
				binderPersonne(personne);
756
				binderPersonne(personne);
757
				//Mise à jour de la personne		
757
				//Mise à jour de la personne		
758
				//Personne personne = (Personne) nouvellesDonnees;
758
				//Personne personne = (Personne) nouvellesDonnees;
759
				
759
				
760
				ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
760
				ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
761
				cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
761
				cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
762
				
762
				
763
				//Prefixe
763
				//Prefixe
764
				String prefixe = personne.get("ce_truk_prefix");
764
				String prefixe = personne.get("ce_truk_prefix");
765
				ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
765
				ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
766
				
766
				
767
				
767
				
768
				String prefixeCourant = personne.get("ce_truk_prefix");
768
				String prefixeCourant = personne.get("ce_truk_prefix");
769
				if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null)	{
769
				if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null)	{
770
					cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
770
					cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
771
				}	else	{
771
				}	else	{
772
					cbPrefixe.setRawValue(prefixeCourant);
772
					cbPrefixe.setRawValue(prefixeCourant);
773
				}
773
				}
774
				
774
				
775
				
775
				
776
				((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
776
				((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
777
				((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
777
				((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
778
				
778
				
779
				//Suffixe
779
				//Suffixe
780
				String suffixe = personne.get("ce_truk_suffixe");
780
				String suffixe = personne.get("ce_truk_suffixe");
781
				ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe");
781
				ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe");
782
				
782
				
783
				String suffixeCourant = personne.get("ce_truk_suffix");
783
				String suffixeCourant = personne.get("ce_truk_suffix");
784
				if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null)	{
784
				if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null)	{
785
					cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
785
					cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
786
				}	else	{
786
				}	else	{
787
					cbSuffixe.setRawValue(suffixeCourant);
787
					cbSuffixe.setRawValue(suffixeCourant);
788
				}
788
				}
789
				
789
				
790
				((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
790
				((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
791
				((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
791
				((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
792
				((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
792
				((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
793
				
793
				
794
				
794
				
795
				(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date"));
795
				(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date"));
796
				((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
796
				((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
797
				
797
				
798
				(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date"));
798
				(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date"));
799
				((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu"));
799
				((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu"));
800
				
800
				
801
				((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone"));
801
				((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone"));
802
				
802
				
803
				//Courriel
803
				//Courriel
804
				((ChampMultiValeurs) hmIdentite.get("courriels")).peupler(personne.getCourriel());
804
				((ChampMultiValeurs) hmIdentite.get("courriels")).peupler(personne.getCourriel());
805
				
805
				
806
				//Sites web
806
				//Sites web
807
				((ChampMultiValeurs) hmIdentite.get("sites")).peupler(personne.getString("truk_url"));
807
				((ChampMultiValeurs) hmIdentite.get("sites")).peupler(personne.getString("truk_url"));
808
				
808
				
809
				
809
				
810
				// Sexe
810
				// Sexe
811
				String strSexe = personne.get("ce_sexe");
811
				String strSexe = personne.get("ce_sexe");
812
				ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe");
812
				ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe");
813
 
813
 
814
				if (cbSexe.getStore().findModel("id_valeur", strSexe) != null)	{
814
				if (cbSexe.getStore().findModel("id_valeur", strSexe) != null)	{
815
					cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe));
815
					cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe));
816
				}	else	{
816
				}	else	{
817
					cbSexe.setRawValue(strSexe);
817
					cbSexe.setRawValue(strSexe);
818
				}
818
				}
819
				
819
				
820
				((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
820
				((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
821
				
821
				
822
				//Logo
822
				//Logo
823
				((ChampMultiValeurs) hmIdentite.get("logos")).peupler(personne.getString("truk_logo"));
823
				((ChampMultiValeurs) hmIdentite.get("logos")).peupler(personne.getString("truk_logo"));
824
				
824
				
825
				/*--------------------------------------------------
825
				/*--------------------------------------------------
826
				                      Adresse
826
				                      Adresse
827
				 ---------------------------------------------------*/
827
				 ---------------------------------------------------*/
828
				
828
				
829
				// Adresse
829
				// Adresse
830
				((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01"));
830
				((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01"));
831
 
831
 
832
				// Complément
832
				// Complément
833
				((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02"));
833
				((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02"));
834
				
834
				
835
				//Boite postale
835
				//Boite postale
836
				((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp"));
836
				((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp"));
837
				
837
				
838
				//Pays
838
				//Pays
839
				String strPays = personne.get("pays");
839
				String strPays = personne.get("pays");
840
				ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays");
840
				ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays");
841
				
841
				
842
				
842
				
843
				if (cbPays.getStore().findModel("nom", strPays) != null)	{
843
				if (cbPays.getStore().findModel("nom", strPays) != null)	{
844
					cbPays.setValue(cbPays.getStore().findModel("nom", strPays));
844
					cbPays.setValue(cbPays.getStore().findModel("nom", strPays));
845
				}	else	{
845
				}	else	{
846
					cbPays.setRawValue(strPays);
846
					cbPays.setRawValue(strPays);
847
				}
847
				}
848
				
848
				
849
				//Région
849
				//Région
850
				String strRegion = personne.get("region");
850
				String strRegion = personne.get("region");
851
				if ((strRegion!=null)&&(!strRegion.equals("")))	{
851
				if ((strRegion!=null)&&(!strRegion.equals("")))	{
852
					ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion");
852
					ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion");
853
					cbRegion.setVisible(true);
853
					cbRegion.setVisible(true);
854
					
854
					
855
					if (cbRegion.getStore().findModel("nom", strRegion) != null)	{
855
					if (cbRegion.getStore().findModel("nom", strRegion) != null)	{
856
						cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion));
856
						cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion));
857
					}	else	{
857
					}	else	{
858
						cbRegion.setRawValue(strRegion);
858
						cbRegion.setRawValue(strRegion);
859
					}
859
					}
860
				}
860
				}
861
				
861
				
862
				//Cp
862
				//Cp
863
				((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
863
				((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
864
				
864
				
865
				//Ville
865
				//Ville
866
				((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
866
				((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
867
				
867
				
868
				gererEtatActivationBouton();
868
				gererEtatActivationBouton();
869
				
869
				
870
				nouvellesDonnees = null;
870
				nouvellesDonnees = null;
871
			} else {
871
			} else {
872
				Info.display("messages", info.getMessages().toString());
872
				Info.display("messages", info.getMessages().toString());
873
			}
873
			}
874
		} 
874
		} 
875
		
875
		
876
		if (nouvellesDonnees == null) {
876
		if (nouvellesDonnees == null) {
877
			ComboBox cb= (ComboBox) hmIdentite.get("cbPrefixe");
877
			ComboBox cb= (ComboBox) hmIdentite.get("cbPrefixe");
878
			
878
			
879
			//Met à jour le nom Complet du formulaire
879
			//Met à jour le nom Complet du formulaire
880
			String valeurRetour = "";
880
			String valeurRetour = "";
881
			
881
			
882
			// Prefixe
882
			// Prefixe
883
			String prefixe = "";
883
			String prefixe = "";
884
			Valeur valPrefixe = (Valeur) ((ComboBox) hmIdentite.get("cbPrefixe")).getValue();
884
			Valeur valPrefixe = (Valeur) ((ComboBox) hmIdentite.get("cbPrefixe")).getValue();
885
			
885
			
886
			if (valPrefixe != null)	{
886
			if (valPrefixe != null)	{
887
				prefixe = valPrefixe.getNom();
887
				prefixe = valPrefixe.getNom();
888
			} else 	{
888
			} else 	{
889
				prefixe =  (String) ((ComboBox) hmIdentite.get("cbPrefixe")).getRawValue();
889
				prefixe =  (String) ((ComboBox) hmIdentite.get("cbPrefixe")).getRawValue();
890
			}		
890
			}		
891
			
891
			
892
			// Prénom
892
			// Prénom
893
			String prenom = (String) ((TextField) hmIdentite.get("tfPrenom")).getValue();
893
			String prenom = (String) ((TextField) hmIdentite.get("tfPrenom")).getValue();
894
			
894
			
895
			// Nom
895
			// Nom
896
			String nom = (String) ((TextField) hmIdentite.get("tfNom")).getValue();
896
			String nom = (String) ((TextField) hmIdentite.get("tfNom")).getValue();
897
			
897
			
898
			// Suffixe
898
			// Suffixe
899
			String suffixe = "";
899
			String suffixe = "";
900
			Valeur valSuffixe = (Valeur) ((ComboBox) hmIdentite.get("cbSuffixe")).getValue();
900
			Valeur valSuffixe = (Valeur) ((ComboBox) hmIdentite.get("cbSuffixe")).getValue();
901
			
901
			
902
			if (valSuffixe != null)	{
902
			if (valSuffixe != null)	{
903
				suffixe = valSuffixe.getNom();
903
				suffixe = valSuffixe.getNom();
904
			} else 	{
904
			} else 	{
905
				suffixe =  (String) ((ComboBox) hmIdentite.get("cbSuffixe")).getRawValue();
905
				suffixe =  (String) ((ComboBox) hmIdentite.get("cbSuffixe")).getRawValue();
906
			}
906
			}
907
			
907
			
908
			// Mettre à jour la valeur
908
			// Mettre à jour la valeur
909
			valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
909
			valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
910
			valeurRetour = valeurRetour.replaceAll("null", "");
910
			valeurRetour = valeurRetour.replaceAll("null", "");
911
			
911
			
912
			((LabelField) hmIdentite.get("nomComplet")).setValue(valeurRetour);
912
			((LabelField) hmIdentite.get("nomComplet")).setValue(valeurRetour);
913
			
913
			
914
			if (!valeurRetour.trim().equals(""))	{
914
			if (!valeurRetour.trim().equals(""))	{
915
				((LabelField) hmIdentite.get("nomComplet")).show();
915
				((LabelField) hmIdentite.get("nomComplet")).show();
916
			} else {
916
			} else {
917
				((LabelField) hmIdentite.get("nomComplet")).hide();
917
				((LabelField) hmIdentite.get("nomComplet")).hide();
918
			}
918
			}
919
		}
919
		}
920
		
920
		
921
		mediateur.masquerPopinChargement();
921
		mediateur.masquerPopinChargement();
922
		
922
		
923
		if (this.mode.equals(MODE_AJOUTER))	{
923
		if (this.mode.equals(MODE_AJOUTER))	{
924
			gererEtatActivationBouton();
924
			gererEtatActivationBouton();
925
		}
925
		}
926
	}
926
	}
927
 
927
 
928
 
928
 
929
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
929
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
930
		HashMap hm = null;
930
		HashMap hm = null;
931
		if (hashMapId.equals("hmIdentite"))	{
931
		if (hashMapId.equals("hmIdentite"))	{
932
			hm = hmIdentite;
932
			hm = hmIdentite;
933
		} else if (hashMapId.equals("hmAdresse")){
933
		} else if (hashMapId.equals("hmAdresse")){
934
			hm = hmAdresse;
934
			hm = hmAdresse;
935
		} else {
935
		} else {
936
			hm = hmInfosNat;
936
			hm = hmInfosNat;
937
		}
937
		}
938
		
938
		
939
		ListStore<Valeur> store = ((ComboBox) hm.get(idComboBox)).getStore();
939
		ListStore<Valeur> store = ((ComboBox) hm.get(idComboBox)).getStore();
940
		
940
		
941
		store.removeAll();
941
		store.removeAll();
942
		store.add(liste);
942
		store.add(liste);
943
		((ComboBox) hm.get(idComboBox)).setStore(store);
943
		((ComboBox) hm.get(idComboBox)).setStore(store);
944
	}
944
	}
945
	
945
	
946
	private void gererEtatActivationBouton()	{
946
	private void gererEtatActivationBouton()	{
947
		if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie() == false)	{			
947
		if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie() == false)	{			
948
			enregistrer.setEnabled(false);
948
			enregistrer.setEnabled(false);
949
			enregistrerEtRevenir.setEnabled(false);
949
			enregistrerEtRevenir.setEnabled(false);
950
		} else	{
950
		} else	{
951
			enregistrer.setEnabled(true);
951
			enregistrer.setEnabled(true);
952
			enregistrerEtRevenir.setEnabled(true);
952
			enregistrerEtRevenir.setEnabled(true);
953
		}
953
		}
954
	}
954
	}
955
	
955
	
956
	public void reinitialiser()	{
956
	public void reinitialiser()	{
957
		mediateur.afficherPopinChargement();
957
		mediateur.afficherPopinChargement();
958
		
958
		
959
		binderPersonne(personneSauvegarde);
959
		binderPersonne(personneSauvegarde);
960
		layout();
960
		layout();
961
		
961
		
962
		mediateur.masquerPopinChargement();
962
		mediateur.masquerPopinChargement();
963
	}
963
	}
964
	
964
	
965
	public void binderPersonne(Personne personne)	{
965
	public void binderPersonne(Personne personne)	{
-
 
966
		binding = new FormBinding(this);
966
			
967
		
967
		personneSelectionnee = personne;
968
		personneSelectionnee = personne;
968
		binding.autoBind();
969
		binding.autoBind();
969
		binding.bind(personneSelectionnee);
970
		binding.bind(personneSelectionnee);
970
		
971
		
971
		layout();
972
		layout();
972
	}
973
	}
973
 
974
 
974
	/**
975
	/**
975
	 * Enregistre les information de la personne en cours 
976
	 * Enregistre les information de la personne en cours 
976
	 * 
977
	 * 
977
	 */
978
	 */
978
	public boolean enregistrer()	{
979
	public boolean enregistrer()	{
979
		boolean success = false;
980
		boolean success = false;
980
		LinkedList lstMessageErreur = new LinkedList<String>();
981
		LinkedList lstMessageErreur = new LinkedList<String>();
981
		
982
		
982
		ComboBox<Projet> cbProjets = (ComboBox<Projet>) hmIdentite.get("cbProjets");
983
		ComboBox<Projet> cbProjets = (ComboBox<Projet>) hmIdentite.get("cbProjets");
983
		Projet projet = cbProjets.getValue();
984
		Projet projet = cbProjets.getValue();
984
		if (projet == null)	{
985
		if (projet == null)	{
985
			lstMessageErreur.add("Le projet n'a pas été renseigné");
986
			lstMessageErreur.add("Le projet n'a pas été renseigné");
986
		} else {
987
		} else {
987
			personneSelectionnee.set("ce_projet", projet.getId());
988
			personneSelectionnee.set("ce_projet", projet.getId());
988
		}
989
		}
989
		
990
		
990
		String strTfNom = ((TextField<String>) hmIdentite.get("tfNom")).getValue();
991
		String strTfNom = ((TextField<String>) hmIdentite.get("tfNom")).getValue();
991
		if ((strTfNom == null)||(strTfNom.trim().equals("")))	{
992
		if ((strTfNom == null)||(strTfNom.trim().equals("")))	{
992
			lstMessageErreur.add("Le nom n'a pas été saisi");
993
			lstMessageErreur.add("Le nom n'a pas été saisi");
993
		} else {
994
		} else {
994
			strTfNom = UtilString.ucFirst(strTfNom);
995
			strTfNom = UtilString.ucFirst(strTfNom);
995
			personneSelectionnee.set("nom", strTfNom);
996
			personneSelectionnee.set("nom", strTfNom);
996
		}
997
		}
997
		
998
		
998
		String strTfPrenom = ((TextField<String>) hmIdentite.get("tfPrenom")).getValue();
999
		String strTfPrenom = ((TextField<String>) hmIdentite.get("tfPrenom")).getValue();
999
		personneSelectionnee.set("prenom", UtilString.ucFirst(strTfPrenom));
1000
		personneSelectionnee.set("prenom", UtilString.ucFirst(strTfPrenom));
1000
		
1001
		
1001
		//Préparer les données
1002
		//Préparer les données
1002
		ComboBox combo = (ComboBox) hmIdentite.get("cbSexe");
1003
		ComboBox combo = (ComboBox) hmIdentite.get("cbSexe");
1003
		Valeur valeur;
1004
		Valeur valeur;
1004
		String strValeur = "";
1005
		String strValeur = "";
1005
		
1006
		
1006
		valeur = (Valeur) combo.getValue();
1007
		valeur = (Valeur) combo.getValue();
1007
		if (valeur!=null)	{
1008
		if (valeur!=null)	{
1008
			personneSelectionnee.set("ce_sexe", valeur.getId());
1009
			personneSelectionnee.set("ce_sexe", valeur.getId());
1009
		}
1010
		}
1010
		
1011
		
1011
		strValeur = obtenirValeurCombo("cbPrefixe");
1012
		strValeur = obtenirValeurCombo("cbPrefixe");
1012
		personneSelectionnee.set("ce_truk_prefix", strValeur);
1013
		personneSelectionnee.set("ce_truk_prefix", strValeur);
1013
		
1014
		
1014
		strValeur = obtenirValeurCombo("cbSuffixe"); 
1015
		strValeur = obtenirValeurCombo("cbSuffixe"); 
1015
		personneSelectionnee.set("ce_truk_suffix", strValeur);
1016
		personneSelectionnee.set("ce_truk_suffix", strValeur);
1016
		
1017
		
1017
		personneSelectionnee.set("truk_courriel", ((ChampMultiValeurs) hmIdentite.get("courriels")).getValeurs());
1018
		personneSelectionnee.set("truk_courriel", ((ChampMultiValeurs) hmIdentite.get("courriels")).getValeurs());
1018
		
1019
		
1019
		
1020
		
1020
		//Pour le nom complet, on enregistre dans la bdd la valeur du prefixe/suffixe et non l'id
1021
		//Pour le nom complet, on enregistre dans la bdd la valeur du prefixe/suffixe et non l'id
1021
		String strPrefixe = "";
1022
		String strPrefixe = "";
1022
		combo = (ComboBox) hmIdentite.get("cbPrefixe");
1023
		combo = (ComboBox) hmIdentite.get("cbPrefixe");
1023
		valeur = (Valeur) combo.getValue();
1024
		valeur = (Valeur) combo.getValue();
1024
		if (valeur != null)	{
1025
		if (valeur != null)	{
1025
			strPrefixe = valeur.getNom();
1026
			strPrefixe = valeur.getNom();
1026
		} else {
1027
		} else {
1027
			strPrefixe = combo.getRawValue();
1028
			strPrefixe = combo.getRawValue();
1028
		}
1029
		}
1029
		
1030
		
1030
		String strSuffixe = "";
1031
		String strSuffixe = "";
1031
		combo = (ComboBox) hmIdentite.get("cbSuffixe");
1032
		combo = (ComboBox) hmIdentite.get("cbSuffixe");
1032
		valeur = (Valeur) combo.getValue();
1033
		valeur = (Valeur) combo.getValue();
1033
		if (valeur != null)	{
1034
		if (valeur != null)	{
1034
			strSuffixe = valeur.getNom() + " ";
1035
			strSuffixe = valeur.getNom() + " ";
1035
		} else {
1036
		} else {
1036
			strSuffixe = combo.getRawValue() +" ";
1037
			strSuffixe = combo.getRawValue() +" ";
1037
		}
1038
		}
1038
		
1039
		
1039
		personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
1040
		personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
1040
		
1041
		
1041
		
1042
		
1042
		DateField dfDateNaissance = (DateField) hmIdentite.get("dfDateNaissance");
1043
		DateField dfDateNaissance = (DateField) hmIdentite.get("dfDateNaissance");
1043
		Date naissanceDate = dfDateNaissance.getValue();
1044
		Date naissanceDate = dfDateNaissance.getValue();
1044
		personneSelectionnee.setNaissanceDate(naissanceDate);
1045
		personneSelectionnee.setNaissanceDate(naissanceDate);
1045
		
1046
		
1046
		Radio rbEstDecedee = (Radio) hmIdentite.get("rbEstDecedee");
1047
		Radio rbEstDecedee = (Radio) hmIdentite.get("rbEstDecedee");
1047
		if (rbEstDecedee.getValue().equals(true))	{
1048
		if (rbEstDecedee.getValue().equals(true))	{
1048
			
1049
			
1049
			DateField dfDecesDate = (DateField) hmIdentite.get("dfDateDeces");
1050
			DateField dfDecesDate = (DateField) hmIdentite.get("dfDateDeces");
1050
			Date decesDate = dfDecesDate.getValue();
1051
			Date decesDate = dfDecesDate.getValue();
1051
			if (decesDate == null)	{
1052
			if (decesDate == null)	{
1052
				decesDate = new Date();
1053
				decesDate = new Date();
1053
			}
1054
			}
1054
			personneSelectionnee.setDecesDate(decesDate);
1055
			personneSelectionnee.setDecesDate(decesDate);
1055
			personneSelectionnee.set("deces_lieu", ((TextField<String>) hmIdentite.get("tfLieuDeces")).getValue());
1056
			personneSelectionnee.set("deces_lieu", ((TextField<String>) hmIdentite.get("tfLieuDeces")).getValue());
1056
		}
1057
		}
1057
		
1058
		
1058
		personneSelectionnee.setDecesDate(new Date());
1059
		personneSelectionnee.setDecesDate(new Date());
1059
		
1060
		
1060
		strValeur = obtenirValeurCombo("cbPays");
1061
		strValeur = obtenirValeurCombo("cbPays");
1061
		personneSelectionnee.set("ce_truk_pays", strValeur);
1062
		personneSelectionnee.set("ce_truk_pays", strValeur);
1062
		
1063
		
1063
		strValeur = obtenirValeurCombo("cbRegion");
1064
		strValeur = obtenirValeurCombo("cbRegion");
1064
		personneSelectionnee.set("ce_truk_region", strValeur);
1065
		personneSelectionnee.set("ce_truk_region", strValeur);
1065
		
1066
		
1066
		personneSelectionnee.set("truk_telephone", ((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).getValeurs());
1067
		personneSelectionnee.set("truk_telephone", ((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).getValeurs());
1067
		
1068
		
1068
		String logoUrls = ((ChampMultiValeursImage) hmIdentite.get("logos")).getValeurs();
1069
		String logoUrls = ((ChampMultiValeursImage) hmIdentite.get("logos")).getValeurs();
1069
		personneSelectionnee.set("truk_logo", logoUrls);
1070
		personneSelectionnee.set("truk_logo", logoUrls);
1070
		
1071
		
1071
		personneSelectionnee.set("truk_url", ((ChampMultiValeurs) hmIdentite.get("sites")).getValeurs());
1072
		personneSelectionnee.set("truk_url", ((ChampMultiValeurs) hmIdentite.get("sites")).getValeurs());
1072
		
1073
		
1073
		if (lstMessageErreur.size() == 0)	{
1074
		if (lstMessageErreur.size() == 0)	{
1074
			mediateur.enregistrerPersonne(this, personneSelectionnee);
1075
			mediateur.enregistrerPersonne(this, personneSelectionnee);
1075
			success = true;
1076
			success = true;
1076
		} else {
1077
		} else {
1077
			String strMessagesErreur = "<span><br />";
1078
			String strMessagesErreur = "<span><br />";
1078
			Iterator<String> itMessagesErreur = lstMessageErreur.iterator();
1079
			Iterator<String> itMessagesErreur = lstMessageErreur.iterator();
1079
			while (itMessagesErreur.hasNext())	{
1080
			while (itMessagesErreur.hasNext())	{
1080
				strMessagesErreur += "<br /> - " + itMessagesErreur.next();
1081
				strMessagesErreur += "<br /> - " + itMessagesErreur.next();
1081
			}
1082
			}
1082
			strMessagesErreur += "</span>";
1083
			strMessagesErreur += "</span>";
1083
			
1084
			
1084
 			MessageBox.alert("Erreurs", "Les erreurs suivantes ont été commises : \n" + strMessagesErreur, null);
1085
 			MessageBox.alert("Erreurs", "Les erreurs suivantes ont été commises : \n" + strMessagesErreur, null);
1085
 			success = false;
1086
 			success = false;
1086
		}
1087
		}
1087
		
1088
		
1088
		return success;
1089
		return success;
1089
	}
1090
	}
1090
	
1091
	
1091
	private String obtenirValeurCombo(String strComboName)	{
1092
	private String obtenirValeurCombo(String strComboName)	{
1092
		String strValeur = "";
1093
		String strValeur = "";
1093
		Valeur valeur;
1094
		Valeur valeur;
1094
		
1095
		
1095
		ComboBox combo = (ComboBox) hmIdentite.get(strComboName);
1096
		ComboBox combo = (ComboBox) hmIdentite.get(strComboName);
1096
		if (combo == null)	{
1097
		if (combo == null)	{
1097
			combo = (ComboBox) hmAdresse.get(strComboName);
1098
			combo = (ComboBox) hmAdresse.get(strComboName);
1098
		}
1099
		}
1099
		if (combo.getValue()!=null)	{
1100
		if (combo.getValue()!=null)	{
1100
			valeur = (Valeur) combo.getValue();
1101
			valeur = (Valeur) combo.getValue();
1101
			strValeur = valeur.getId();
1102
			strValeur = valeur.getId();
1102
		} else {
1103
		} else {
1103
			strValeur = combo.getRawValue();
1104
			strValeur = combo.getRawValue();
1104
		}
1105
		}
1105
		
1106
		
1106
		return strValeur;
1107
		return strValeur;
1107
	}
1108
	}
1108
}
1109
}