Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 519 Rev 540
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.images.Images;
14
import org.tela_botanica.client.images.Images;
15
import org.tela_botanica.client.interfaces.Rafraichissable;
15
import org.tela_botanica.client.interfaces.Rafraichissable;
16
import org.tela_botanica.client.modeles.Configuration;
16
import org.tela_botanica.client.modeles.Configuration;
17
 
17
 
18
import org.tela_botanica.client.modeles.Information;
18
import org.tela_botanica.client.modeles.Information;
19
import org.tela_botanica.client.modeles.Personne;
19
import org.tela_botanica.client.modeles.Personne;
20
import org.tela_botanica.client.modeles.PersonneListe;
20
import org.tela_botanica.client.modeles.PersonneListe;
21
import org.tela_botanica.client.modeles.Projet;
21
import org.tela_botanica.client.modeles.Projet;
22
import org.tela_botanica.client.modeles.ProjetListe;
22
import org.tela_botanica.client.modeles.ProjetListe;
23
import org.tela_botanica.client.modeles.Valeur;
23
import org.tela_botanica.client.modeles.Valeur;
24
import org.tela_botanica.client.modeles.ValeurListe;
24
import org.tela_botanica.client.modeles.ValeurListe;
25
 
25
 
26
import com.extjs.gxt.ui.client.event.Events;
26
import com.extjs.gxt.ui.client.event.Events;
27
import com.extjs.gxt.ui.client.Registry;
27
import com.extjs.gxt.ui.client.Registry;
28
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
28
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
29
import com.extjs.gxt.ui.client.Style.IconAlign;
29
import com.extjs.gxt.ui.client.Style.IconAlign;
30
import com.extjs.gxt.ui.client.Style.Scroll;
30
import com.extjs.gxt.ui.client.Style.Scroll;
31
 
31
 
32
import com.extjs.gxt.ui.client.binding.FormBinding;
32
import com.extjs.gxt.ui.client.binding.FormBinding;
33
 
33
 
34
import com.extjs.gxt.ui.client.event.ButtonEvent;
34
import com.extjs.gxt.ui.client.event.ButtonEvent;
35
import com.extjs.gxt.ui.client.event.ComponentEvent;
35
import com.extjs.gxt.ui.client.event.ComponentEvent;
36
import com.extjs.gxt.ui.client.event.IconButtonEvent;
36
import com.extjs.gxt.ui.client.event.IconButtonEvent;
37
import com.extjs.gxt.ui.client.event.KeyListener;
37
import com.extjs.gxt.ui.client.event.KeyListener;
38
import com.extjs.gxt.ui.client.event.Listener;
38
import com.extjs.gxt.ui.client.event.Listener;
39
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
39
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
40
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
40
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
41
import com.extjs.gxt.ui.client.event.SelectionListener;
41
import com.extjs.gxt.ui.client.event.SelectionListener;
42
import com.extjs.gxt.ui.client.store.ListStore;
42
import com.extjs.gxt.ui.client.store.ListStore;
43
import com.extjs.gxt.ui.client.widget.LayoutContainer;
43
import com.extjs.gxt.ui.client.widget.LayoutContainer;
44
import com.extjs.gxt.ui.client.widget.MessageBox;
44
import com.extjs.gxt.ui.client.widget.MessageBox;
45
 
45
 
46
import com.extjs.gxt.ui.client.widget.Info;
46
import com.extjs.gxt.ui.client.widget.Info;
47
import com.extjs.gxt.ui.client.widget.TabItem;
47
import com.extjs.gxt.ui.client.widget.TabItem;
48
import com.extjs.gxt.ui.client.widget.TabPanel;
48
import com.extjs.gxt.ui.client.widget.TabPanel;
49
import com.extjs.gxt.ui.client.widget.Text;
49
import com.extjs.gxt.ui.client.widget.Text;
50
 
50
 
51
import com.extjs.gxt.ui.client.widget.button.Button;
51
import com.extjs.gxt.ui.client.widget.button.Button;
52
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
52
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
53
import com.extjs.gxt.ui.client.widget.button.IconButton;
53
import com.extjs.gxt.ui.client.widget.button.IconButton;
54
import com.extjs.gxt.ui.client.widget.form.ComboBox;
54
import com.extjs.gxt.ui.client.widget.form.ComboBox;
55
import com.extjs.gxt.ui.client.widget.form.DateField;
55
import com.extjs.gxt.ui.client.widget.form.DateField;
56
import com.extjs.gxt.ui.client.widget.form.FieldSet;
56
import com.extjs.gxt.ui.client.widget.form.FieldSet;
57
import com.extjs.gxt.ui.client.widget.form.FormPanel;
57
import com.extjs.gxt.ui.client.widget.form.FormPanel;
58
import com.extjs.gxt.ui.client.widget.form.HiddenField;
58
import com.extjs.gxt.ui.client.widget.form.HiddenField;
59
import com.extjs.gxt.ui.client.widget.form.LabelField;
59
import com.extjs.gxt.ui.client.widget.form.LabelField;
60
import com.extjs.gxt.ui.client.widget.form.Radio;
60
import com.extjs.gxt.ui.client.widget.form.Radio;
61
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
61
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
62
import com.extjs.gxt.ui.client.widget.form.TextArea;
62
import com.extjs.gxt.ui.client.widget.form.TextArea;
63
import com.extjs.gxt.ui.client.widget.form.TextField;
63
import com.extjs.gxt.ui.client.widget.form.TextField;
64
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
64
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
65
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
65
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
66
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
66
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
67
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
67
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
68
import com.extjs.gxt.ui.client.widget.layout.FormData;
68
import com.extjs.gxt.ui.client.widget.layout.FormData;
69
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
69
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
70
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
70
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
71
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
71
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
72
import com.google.gwt.core.client.GWT;
72
import com.google.gwt.core.client.GWT;
73
import com.google.gwt.i18n.client.DateTimeFormat;
73
import com.google.gwt.i18n.client.DateTimeFormat;
74
import com.google.gwt.user.client.ui.Widget;
74
import com.google.gwt.user.client.ui.Widget;
75
 
75
 
76
public class PersonneForm extends FormPanel implements Rafraichissable {
76
public class PersonneForm extends FormPanel implements Rafraichissable {
77
 
77
 
78
	/*--------------------------------------------------------------------------------------
78
	/*--------------------------------------------------------------------------------------
79
	 * 		VARIABLES
79
	 * 		VARIABLES
80
	 * -------------------------------------------------------------------------------------
80
	 * -------------------------------------------------------------------------------------
81
	 */
81
	 */
82
	
82
	
83
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
83
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
84
	private Mediateur mediateur = Registry.get(RegistreId.MEDIATEUR);
84
	private Mediateur mediateur = Registry.get(RegistreId.MEDIATEUR);
85
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
85
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
86
	private Personne personneSelectionnee, personneSauvegarde = null;
86
	private Personne personneSelectionnee, personneSauvegarde = null;
87
	private String mode = "";
87
	private String mode = "";
88
	
88
	
89
	public static final String MODE_AJOUTER = "AJOUT";
89
	public static final String MODE_AJOUTER = "AJOUT";
90
	public static final String MODE_MODIFIER = "MODIF";
90
	public static final String MODE_MODIFIER = "MODIF";
91
	
91
	
92
	
92
	
93
	private FormBinding binding = null;
93
	private FormBinding binding = null;
94
	
94
	
95
	/*--------------------------------------------------------------------------------------
95
	/*--------------------------------------------------------------------------------------
96
	 * 		CONSTRUCTEUR 
96
	 * 		CONSTRUCTEUR 
97
	 * -------------------------------------------------------------------------------------
97
	 * -------------------------------------------------------------------------------------
98
	 */
98
	 */
99
	
99
	
100
	/**
100
	/**
101
	 * Constructeur du panneau
101
	 * Constructeur du panneau
102
	 * 
102
	 * 
103
	 * Initialise le panneau et ajoute une barre d'outils à deux boutons (réinitialiser le 
103
	 * Initialise le panneau et ajoute une barre d'outils à deux boutons (réinitialiser le 
104
	 * formulaire et annuler la saisie). 
104
	 * formulaire et annuler la saisie). 
105
	 * 
105
	 * 
106
	 * */
106
	 * */
107
	public PersonneForm(String mode) {
107
	public PersonneForm(String mode) {
108
		this.mode = mode;
108
		this.mode = mode;
109
		initialiserComposants();
109
		initialiserComposants();
110
	}
110
	}
111
	
111
	
112
	public void initialiserComposants()	{
112
	public void initialiserComposants()	{
113
		
113
		
114
		personneSelectionnee = new Personne();
114
		personneSelectionnee = new Personne();
115
		personneSauvegarde = new Personne();
115
		personneSauvegarde = new Personne();
116
		
116
		
117
		initialiserPanneau();
117
		initialiserPanneau();
118
		
118
		
119
		ButtonBar barreOutilsBas = new ButtonBar();
119
		ButtonBar barreOutilsBas = new ButtonBar();
120
		//barreOutilsBas.setButtonAlign(HorizontalAlignment.CENTER);
120
		//barreOutilsBas.setButtonAlign(HorizontalAlignment.CENTER);
121
		barreOutilsBas.setAlignment(HorizontalAlignment.CENTER);
121
		barreOutilsBas.setAlignment(HorizontalAlignment.CENTER);
122
		
122
		
123
		ajouterBoutonEnregistrer(barreOutilsBas);
123
		ajouterBoutonEnregistrer(barreOutilsBas);
124
		ajouterBoutonEnregistrerEtRevenir(barreOutilsBas);
124
		ajouterBoutonEnregistrerEtRevenir(barreOutilsBas);
125
		ajouterBoutonAnnuler(barreOutilsBas);
125
		ajouterBoutonAnnuler(barreOutilsBas);
126
		
126
		
127
		setBottomComponent(barreOutilsBas);
127
		setBottomComponent(barreOutilsBas);
128
		
128
		
129
		ToolBar barreOutilsHaut = new ToolBar();
129
		ToolBar barreOutilsHaut = new ToolBar();
130
		ajouterBoutonReinitialiser(barreOutilsHaut);
130
		ajouterBoutonReinitialiser(barreOutilsHaut);
131
		setTopComponent(barreOutilsHaut);
131
		setTopComponent(barreOutilsHaut);
132
		
132
		
133
		initialiserOnglets();	
133
		initialiserOnglets();	
134
		
134
		
135
		creerComposantsIdentite();
135
		creerComposantsIdentite();
136
		creerComposantsAdresse();
136
		creerComposantsAdresse();
137
		
137
		
138
		layout();
138
		layout();
139
		
139
		
140
		binderPersonne(personneSelectionnee);
140
		binderPersonne(personneSelectionnee);
141
	}
141
	}
142
	
142
	
143
	/*---------------------------------------------------------------------------------------
143
	/*---------------------------------------------------------------------------------------
144
	 * 		SOUS-METHODES
144
	 * 		SOUS-METHODES
145
	 * --------------------------------------------------------------------------------------
145
	 * --------------------------------------------------------------------------------------
146
	 */
146
	 */
147
	/**
147
	/**
148
	 * Inialise le panneau donné
148
	 * Inialise le panneau donné
149
	 * 
149
	 * 
150
	 * @param contentPanel le panneau à initialiser
150
	 * @param contentPanel le panneau à initialiser
151
	 * */
151
	 * */
152
	public void initialiserPanneau()	{
152
	public void initialiserPanneau()	{
153
		
153
		
154
		setCollapsible(false);  
154
		setCollapsible(false);  
155
		if (this.mode.equals(MODE_AJOUTER))	{
155
		if (this.mode.equals(MODE_AJOUTER))	{
156
			setHeading(mediateur.i18nC.personneModeAjout());
156
			setHeading(mediateur.i18nC.personneModeAjout());
157
			setIcon(Images.ICONES.ajouter());
157
			setIcon(Images.ICONES.ajouter());
158
		} else 	{
158
		} else 	{
159
			setHeading(mediateur.i18nC.personneModeModifier());
159
			setHeading(mediateur.i18nC.personneModeModifier());
160
			setIcon(Images.ICONES.formModifier());
160
			setIcon(Images.ICONES.formModifier());
161
		}
161
		}
162
		setButtonAlign(HorizontalAlignment.CENTER);  
162
		setButtonAlign(HorizontalAlignment.CENTER);  
163
		setLayout(new FitLayout());
163
		setLayout(new FitLayout());
164
		setBodyBorder(false);
164
		setBodyBorder(false);
165
		setBorders(false);
165
		setBorders(false);
166
		setPadding(0);
166
		setPadding(0);
167
		setWidth("100%");
167
		setWidth("100%");
168
	
168
	
169
	}
169
	}
170
	
170
	
171
	/**
171
	/**
172
	 * Crée les onglets identité, adresse et informations naturaliste
172
	 * Crée les onglets identité, adresse et informations naturaliste
173
	 * 
173
	 * 
174
	 * */
174
	 * */
175
	public void initialiserOnglets()	{
175
	public void initialiserOnglets()	{
176
		//TabPanel
176
		//TabPanel
177
		TabPanel formulaireOnglets = new TabPanel();
177
		TabPanel formulaireOnglets = new TabPanel();
178
		
178
		
179
		//Tab 1 : identite
179
		//Tab 1 : identite
180
		tiIdentite = new TabItem(mediateur.i18nC.personneIdentite());
180
		tiIdentite = new TabItem(mediateur.i18nC.personneIdentite());
181
		tiIdentite.setLayout(new FormLayout());
181
		tiIdentite.setLayout(new FormLayout());
182
		tiIdentite.setScrollMode(Scroll.AUTO);
182
		tiIdentite.setScrollMode(Scroll.AUTO);
183
		
183
		
184
		formulaireOnglets.add(tiIdentite);
184
		formulaireOnglets.add(tiIdentite);
185
		hmIdentite.put("tiIdentite", tiIdentite);
185
		hmIdentite.put("tiIdentite", tiIdentite);
186
		
186
		
187
		//Tab 2 : Adresse
187
		//Tab 2 : Adresse
188
		tiAdresses = new TabItem(mediateur.i18nC.adresse());
188
		tiAdresses = new TabItem(mediateur.i18nC.adresse());
189
		tiAdresses.setLayout(new FormLayout());
189
		tiAdresses.setLayout(new FormLayout());
190
		tiAdresses.setScrollMode(Scroll.AUTO);
190
		tiAdresses.setScrollMode(Scroll.AUTO);
191
		
191
		
192
		formulaireOnglets.add(tiAdresses);
192
		formulaireOnglets.add(tiAdresses);
193
		
193
		
194
		//Tab 3 : Infos Naturalistes
194
		//Tab 3 : Infos Naturalistes
195
		tiInfosNat = new TabItem(mediateur.i18nC.personneInfoNat());
195
		tiInfosNat = new TabItem(mediateur.i18nC.personneInfoNat());
196
		tiInfosNat.setLayout(new FormLayout());
196
		tiInfosNat.setLayout(new FormLayout());
197
		tiInfosNat.setScrollMode(Scroll.AUTO);
197
		tiInfosNat.setScrollMode(Scroll.AUTO);
198
		
198
		
199
		formulaireOnglets.add(tiInfosNat);
199
		formulaireOnglets.add(tiInfosNat);
200
		add(formulaireOnglets);
200
		add(formulaireOnglets);
201
	}
201
	}
202
	
202
	
203
	/**
203
	/**
204
	 * Crée les widgets pour l'onglet identité
204
	 * Crée les widgets pour l'onglet identité
205
	 * 
205
	 * 
206
	 * */
206
	 * */
207
	
207
	
208
	//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
208
	//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
209
	private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
209
	private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
210
	private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>();
210
	private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>();
211
	private HashMap<String, Widget>hmInfosNat = new HashMap<String, Widget>();
211
	private HashMap<String, Widget>hmInfosNat = new HashMap<String, Widget>();
212
	private FormData fd100 = new FormData("1");
212
	private FormData fd100 = new FormData("1");
213
	
213
	
214
	public void creerComposantsIdentite()	{
214
	public void creerComposantsIdentite()	{
215
		
215
		
216
		
216
		
217
			// Gestion de l'affichage en colonnes : 3 Layout container : principal, gauche & droite
217
			// Gestion de l'affichage en colonnes : 3 Layout container : principal, gauche & droite
218
			LayoutContainer left = new LayoutContainer();
218
			LayoutContainer left = new LayoutContainer();
219
			left.setLayout(new FormLayout());
219
			left.setLayout(new FormLayout());
220
			LayoutContainer right = new LayoutContainer();
220
			LayoutContainer right = new LayoutContainer();
221
			right.setLayout(new FormLayout());
221
			right.setLayout(new FormLayout());
222
			
222
			
223
			LayoutContainer main = new LayoutContainer();
223
			LayoutContainer main = new LayoutContainer();
224
			
224
			
225
			main.add(left, new ColumnData(.45));
225
			main.add(left, new ColumnData(.45));
226
			main.add(right, new ColumnData(.45));
226
			main.add(right, new ColumnData(.45));
227
			
227
			
228
			main.setLayout(new ColumnLayout());
228
			main.setLayout(new ColumnLayout());
229
			main.setHeight("100%");
229
			main.setHeight("100%");
230
			main.setScrollMode(Scroll.AUTO);
230
			main.setScrollMode(Scroll.AUTO);
231
			
231
			
232
			// Création des champs
232
			// Création des champs
233
			FormLayout formLayout = new FormLayout();
233
			FormLayout formLayout = new FormLayout();
234
			formLayout.setLabelAlign(LabelAlign.LEFT);
234
			formLayout.setLabelAlign(LabelAlign.LEFT);
235
			
235
			
236
				FieldSet fsProjet = new FieldSet();
236
				FieldSet fsProjet = new FieldSet();
237
				fsProjet.setHeading(mediateur.i18nC.menuProjet());
237
				fsProjet.setHeading(mediateur.i18nC.menuProjet());
238
				fsProjet.setLayout(new FormLayout());
238
				fsProjet.setLayout(new FormLayout());
239
				
239
				
240
					ListStore<Projet> storeProjets = new ListStore<Projet>();
240
					ListStore<Projet> storeProjets = new ListStore<Projet>();
241
					ComboBox cbProjets = new ComboBox<Projet>();
241
					ComboBox cbProjets = new ComboBox<Projet>();
242
					cbProjets.setFieldLabel(mediateur.i18nC.personneProjet()+ " :");
242
					cbProjets.setFieldLabel(mediateur.i18nC.personneProjet()+ " :");
243
					cbProjets.setEmptyText(mediateur.i18nC.txtListeProjetDefaut());
243
					cbProjets.setEmptyText(mediateur.i18nC.txtListeProjetDefaut());
244
					cbProjets.setLabelSeparator("");
244
					cbProjets.setLabelSeparator("");
245
					cbProjets.setDisplayField("nom");
245
					cbProjets.setDisplayField("nom");
246
					cbProjets.setEditable(false);
246
					cbProjets.setEditable(false);
247
					cbProjets.setTriggerAction(TriggerAction.ALL);
247
					cbProjets.setTriggerAction(TriggerAction.ALL);
248
					cbProjets.setStore(storeProjets);
248
					cbProjets.setStore(storeProjets);
249
					cbProjets.setAllowBlank(false);
249
					cbProjets.setAllowBlank(false);
250
					fsProjet.add(cbProjets);
250
					fsProjet.add(cbProjets);
251
					
251
					
252
					hmIdentite.put("cbProjets", cbProjets);
252
					hmIdentite.put("cbProjets", cbProjets);
253
					
253
					
254
					mediateur.selectionnerProjets(this);
254
					mediateur.selectionnerProjets(this);
255
				
255
				
256
				left.add(fsProjet);
256
				left.add(fsProjet);
257
					
257
					
258
				
258
				
259
				FieldSet fsNoms = new FieldSet();
259
				FieldSet fsNoms = new FieldSet();
260
				fsNoms.setHeading("Noms");
260
				fsNoms.setHeading("Noms");
261
				fsNoms.setLayout(formLayout); 
261
				fsNoms.setLayout(formLayout); 
262
					
262
					
263
					// Nom complet : Affiché que si valeurs saisies
263
					// Nom complet : Affiché que si valeurs saisies
264
					LabelField nomComplet = new LabelField();
264
					LabelField nomComplet = new LabelField();
265
					nomComplet.setFieldLabel(mediateur.i18nC.personneNomComplet() +" :");
265
					nomComplet.setFieldLabel(mediateur.i18nC.personneNomComplet() +" :");
266
					nomComplet.hide();
266
					nomComplet.hide();
267
				
267
				
268
					fsNoms.add(nomComplet);
268
					fsNoms.add(nomComplet);
269
					hmIdentite.put("nomComplet", nomComplet);
269
					hmIdentite.put("nomComplet", nomComplet);
270
			
270
			
271
					//Préfixe
271
					//Préfixe
272
					ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
272
					ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
273
					ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
273
					ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
274
					cbPrefixe.setStore(storePrefixe);
274
					cbPrefixe.setStore(storePrefixe);
275
					cbPrefixe.setDisplayField("nom");
275
					cbPrefixe.setDisplayField("nom");
276
					cbPrefixe.setEmptyText("Choisissez le préfixe:");
276
					cbPrefixe.setEmptyText("Choisissez le préfixe:");
277
					cbPrefixe.setFieldLabel("Prefix");
277
					cbPrefixe.setFieldLabel("Prefix");
278
					
278
					
279
					fsNoms.add(cbPrefixe);
279
					fsNoms.add(cbPrefixe);
280
					hmIdentite.put("cbPrefixe", cbPrefixe);
280
					hmIdentite.put("cbPrefixe", cbPrefixe);
281
					
281
					
282
					mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
282
					mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
283
			
283
			
284
					//Prénom
284
					//Prénom
285
					TextField<String> tfPrenom = new TextField<String>();
285
					TextField<String> tfPrenom = new TextField<String>();
286
					tfPrenom.setFieldLabel("Prénom");
286
					tfPrenom.setFieldLabel("Prénom");
287
					tfPrenom.setName("prenom");
287
					tfPrenom.setName("prenom");
288
			
288
			
289
					fsNoms.add(tfPrenom);
289
					fsNoms.add(tfPrenom);
290
					hmIdentite.put("tfPrenom", tfPrenom);
290
					hmIdentite.put("tfPrenom", tfPrenom);
291
			
291
			
292
					//Nom
292
					//Nom
293
					TextField<String> tfNom = new TextField<String>();
293
					TextField<String> tfNom = new TextField<String>();
294
					tfNom.setFieldLabel("Nom");
294
					tfNom.setFieldLabel("Nom");
295
					tfNom.setAllowBlank(false);
295
					tfNom.setAllowBlank(false);
296
					tfNom.setName("nom");
296
					tfNom.setName("nom");
297
					
297
					
298
					fsNoms.add(tfNom);
298
					fsNoms.add(tfNom);
299
					hmIdentite.put("tfNom", tfNom);
299
					hmIdentite.put("tfNom", tfNom);
300
					
300
					
301
					//Suffixe
301
					//Suffixe
302
					ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
302
					ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
303
					ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
303
					ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
304
					cbSuffixe.setStore(storeSuffixe);
304
					cbSuffixe.setStore(storeSuffixe);
305
					cbSuffixe.setFieldLabel("Suffixe");
305
					cbSuffixe.setFieldLabel("Suffixe");
306
					cbSuffixe.setDisplayField("nom");
306
					cbSuffixe.setDisplayField("nom");
307
					cbSuffixe.setEmptyText("Choisissez un suffixe:");
307
					cbSuffixe.setEmptyText("Choisissez un suffixe:");
308
					
308
					
309
					fsNoms.add(cbSuffixe);			
309
					fsNoms.add(cbSuffixe);			
310
					hmIdentite.put("cbSuffixe", cbSuffixe);
310
					hmIdentite.put("cbSuffixe", cbSuffixe);
311
					
311
					
312
					mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
312
					mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
313
			
313
			
314
					TextField<String> tfNomAutre = new TextField();
314
					TextField<String> tfNomAutre = new TextField();
315
					tfNomAutre.setFieldLabel("Autres noms");
315
					tfNomAutre.setFieldLabel("Autres noms");
316
					tfNomAutre.setName("truk_nom_autre");
316
					tfNomAutre.setName("truk_nom_autre");
317
					
317
					
318
					fsNoms.add(tfNomAutre);
318
					fsNoms.add(tfNomAutre);
319
					hmIdentite.put("tfNomAutre", tfNomAutre);
319
					hmIdentite.put("tfNomAutre", tfNomAutre);
320
					
320
					
321
					TextField<String> tfAbreviation = new TextField<String>();
321
					TextField<String> tfAbreviation = new TextField<String>();
322
					tfAbreviation.setFieldLabel("Abréviation");
322
					tfAbreviation.setFieldLabel("Abréviation");
323
					tfAbreviation.setName("abreviation");
323
					tfAbreviation.setName("abreviation");
324
					
324
					
325
					fsNoms.add(tfAbreviation);
325
					fsNoms.add(tfAbreviation);
326
					hmIdentite.put("tfAbreviation", tfAbreviation);
326
					hmIdentite.put("tfAbreviation", tfAbreviation);
327
			
327
			
328
					//Abréviation autres
328
					//Abréviation autres
329
					TextField<String> tfAbreviationAutre = new TextField<String>();
329
					TextField<String> tfAbreviationAutre = new TextField<String>();
330
					tfAbreviationAutre.setFieldLabel("Autres Abrév.");
330
					tfAbreviationAutre.setFieldLabel("Autres Abrév.");
331
					tfAbreviationAutre.setName("truk_abreviation_autre");
331
					tfAbreviationAutre.setName("truk_abreviation_autre");
332
					
332
					
333
					fsNoms.add(tfAbreviationAutre);
333
					fsNoms.add(tfAbreviationAutre);
334
					hmIdentite.put("tfAbreviationAutre", tfAbreviationAutre);
334
					hmIdentite.put("tfAbreviationAutre", tfAbreviationAutre);
335
										
335
										
336
				left.add(fsNoms);
336
				left.add(fsNoms);
337
			
337
			
338
				formLayout = new FormLayout();
338
				formLayout = new FormLayout();
339
				formLayout.setLabelAlign(LabelAlign.LEFT);
339
				formLayout.setLabelAlign(LabelAlign.LEFT);
340
			
340
			
341
				FieldSet fsNaissance = new FieldSet();
341
				FieldSet fsNaissance = new FieldSet();
342
				fsNaissance.setHeading("Naissance");
342
				fsNaissance.setHeading("Naissance");
343
				fsNaissance.setLayout(formLayout); 
343
				fsNaissance.setLayout(formLayout); 
344
			
344
			
345
					DateField dfDateNaissance = new DateField();
345
					DateField dfDateNaissance = new DateField();
346
					dfDateNaissance.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
346
					dfDateNaissance.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
347
					dfDateNaissance.setFieldLabel("Date");
347
					dfDateNaissance.setFieldLabel("Date");
348
					dfDateNaissance.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
348
					dfDateNaissance.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
349
					
349
					
350
					fsNaissance.add(dfDateNaissance);
350
					fsNaissance.add(dfDateNaissance);
351
					hmIdentite.put("dfDateNaissance", dfDateNaissance);
351
					hmIdentite.put("dfDateNaissance", dfDateNaissance);
352
					
352
					
353
					// Lieu naissance
353
					// Lieu naissance
354
					TextField<String> tfLieuNaissance = new TextField();
354
					TextField<String> tfLieuNaissance = new TextField();
355
					tfLieuNaissance.setFieldLabel("Lieu");
355
					tfLieuNaissance.setFieldLabel("Lieu");
356
					tfLieuNaissance.setName("naissance_lieu");
356
					tfLieuNaissance.setName("naissance_lieu");
357
					
357
					
358
					fsNaissance.add(tfLieuNaissance);
358
					fsNaissance.add(tfLieuNaissance);
359
					hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
359
					hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
360
					
360
					
361
				left.add(fsNaissance);
361
				left.add(fsNaissance);
362
			
362
			
363
				formLayout = new FormLayout();
363
				formLayout = new FormLayout();
364
				formLayout.setLabelAlign(LabelAlign.LEFT);
364
				formLayout.setLabelAlign(LabelAlign.LEFT);
365
			
365
			
366
				FieldSet fsDeces = new FieldSet();
366
				FieldSet fsDeces = new FieldSet();
367
				fsDeces.setHeading("Décès");
367
				fsDeces.setHeading("Décès");
368
				fsDeces.setLayout(formLayout); 
368
				fsDeces.setLayout(formLayout); 
369
					
369
					
370
					Radio rbEstDecedee = new Radio();
370
					Radio rbEstDecedee = new Radio();
371
					rbEstDecedee.setBoxLabel("oui");
371
					rbEstDecedee.setBoxLabel("oui");
372
					
372
					
373
					rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
373
					rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
374
						
374
						
375
						public void handleEvent(ComponentEvent be) {
375
						public void handleEvent(ComponentEvent be) {
376
							if(((Radio) be.getComponent()).getValue().equals(true))	{
376
							if(((Radio) be.getComponent()).getValue().equals(true))	{
377
								((DateField) hmIdentite.get("dfDateDeces")).setVisible(true);
377
								((DateField) hmIdentite.get("dfDateDeces")).setVisible(true);
378
								((TextField) hmIdentite.get("tfLieuDeces")).setVisible(true);
378
								((TextField) hmIdentite.get("tfLieuDeces")).setVisible(true);
379
							} else	{
379
							} else	{
380
								((DateField) hmIdentite.get("dfDateDeces")).setVisible(false);
380
								((DateField) hmIdentite.get("dfDateDeces")).setVisible(false);
381
								((TextField) hmIdentite.get("tfLieuDeces")).setVisible(false);
381
								((TextField) hmIdentite.get("tfLieuDeces")).setVisible(false);
382
							}
382
							}
383
						}	
383
						}	
384
					});
384
					});
385
					
385
					
386
					hmIdentite.put("rbEstDecedee", rbEstDecedee);
386
					hmIdentite.put("rbEstDecedee", rbEstDecedee);
387
					
387
					
388
					Radio rbNestPasDecedee = new Radio();
388
					Radio rbNestPasDecedee = new Radio();
389
					rbNestPasDecedee.setBoxLabel("non");
389
					rbNestPasDecedee.setBoxLabel("non");
390
					rbNestPasDecedee.setValue(true);
390
					rbNestPasDecedee.setValue(true);
391
					
391
					
392
					RadioGroup rbgDeces = new RadioGroup();
392
					RadioGroup rbgDeces = new RadioGroup();
393
					rbgDeces.setFieldLabel("Est décédée");
393
					rbgDeces.setFieldLabel("Est décédée");
394
					rbgDeces.add(rbEstDecedee);
394
					rbgDeces.add(rbEstDecedee);
395
					rbgDeces.add(rbNestPasDecedee);
395
					rbgDeces.add(rbNestPasDecedee);
396
					
396
					
397
					fsDeces.add(rbgDeces);
397
					fsDeces.add(rbgDeces);
398
					
398
					
399
					DateField dfDateDeces = new DateField();
399
					DateField dfDateDeces = new DateField();
400
					dfDateDeces.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
400
					dfDateDeces.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
401
					dfDateDeces.setFormatValue(true);
401
					dfDateDeces.setFormatValue(true);
402
					dfDateDeces.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
402
					dfDateDeces.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
403
					dfDateDeces.setFieldLabel("Date");
403
					dfDateDeces.setFieldLabel("Date");
404
					dfDateDeces.setVisible(false);
404
					dfDateDeces.setVisible(false);
405
			
405
			
406
					fsDeces.add(dfDateDeces);
406
					fsDeces.add(dfDateDeces);
407
					hmIdentite.put("dfDateDeces", dfDateDeces);
407
					hmIdentite.put("dfDateDeces", dfDateDeces);
408
			
408
			
409
					TextField<String> tfLieuDeces = new TextField();
409
					TextField<String> tfLieuDeces = new TextField();
410
					tfLieuDeces.setFieldLabel("Lieu");
410
					tfLieuDeces.setFieldLabel("Lieu");
411
					tfLieuDeces.setName("deces_lieu");
411
					tfLieuDeces.setName("deces_lieu");
412
					tfLieuDeces.setVisible(false);
412
					tfLieuDeces.setVisible(false);
413
					
413
					
414
					fsDeces.add(tfLieuDeces);
414
					fsDeces.add(tfLieuDeces);
415
					hmIdentite.put("tfLieuDeces", tfLieuDeces);
415
					hmIdentite.put("tfLieuDeces", tfLieuDeces);
416
								
416
								
417
				left.add(fsDeces);
417
				left.add(fsDeces);
418
			
418
			
419
			tiIdentite.add(main);
419
			tiIdentite.add(main);
420
			
420
			
421
				FieldSet fsContactTel = new FieldSet();
421
				FieldSet fsContactTel = new FieldSet();
422
				fsContactTel.setHeading("Contact - Téléphones");
422
				fsContactTel.setHeading("Contact - Téléphones");
423
				fsContactTel.setLayout(new RowLayout());
423
				fsContactTel.setLayout(new RowLayout());
424
				
424
				
425
				right.add(fsContactTel);
425
				right.add(fsContactTel);
426
				hmIdentite.put("fsContactTel", fsContactTel);
426
				hmIdentite.put("fsContactTel", fsContactTel);
427
				
427
				
428
					LayoutContainer lcTelephone = new LayoutContainer();
428
					LayoutContainer lcTelephone = new LayoutContainer();
429
					lcTelephone.setLayout(new ColumnLayout());
429
					lcTelephone.setLayout(new ColumnLayout());
430
					
430
					
431
						TextField tfTelephone = new TextField();
431
						TextField tfTelephone = new TextField();
432
						tfTelephone.setFieldLabel("tel");
432
						tfTelephone.setFieldLabel("tel");
433
						lcTelephone.add(tfTelephone, new ColumnData(0.40));
433
						lcTelephone.add(tfTelephone, new ColumnData(0.40));
434
				
434
				
435
						hmIdentite.put("tfTelephone", tfTelephone);
435
						hmIdentite.put("tfTelephone", tfTelephone);
436
				
436
				
437
						ListStore<Valeur> storeTel = new ListStore<Valeur>();
437
						ListStore<Valeur> storeTel = new ListStore<Valeur>();
438
						ComboBox<Valeur> cbTelephone = new ComboBox<Valeur>();
438
						ComboBox<Valeur> cbTelephone = new ComboBox<Valeur>();
439
						cbTelephone.setDisplayField("nom");
439
						cbTelephone.setDisplayField("nom");
440
						cbTelephone.setEmptyText("Choisissez:");
440
						cbTelephone.setEmptyText("Choisissez:");
441
						cbTelephone.setStore(storeTel);
441
						cbTelephone.setStore(storeTel);
442
						
442
						
443
						lcTelephone.add(cbTelephone, new ColumnData(0.40));
443
						lcTelephone.add(cbTelephone, new ColumnData(0.40));
444
						hmIdentite.put("cbTelephone", cbTelephone);
444
						hmIdentite.put("cbTelephone", cbTelephone);
445
			
445
			
446
						mediateur.obtenirListeValeurEtRafraichir(this, "tel");
446
						mediateur.obtenirListeValeurEtRafraichir(this, "tel");
447
			
447
			
-
 
448
						Button bAjouter = new Button();
-
 
449
						bAjouter.setIcon(Images.ICONES.ajouter());
448
						IconButton bAjouter = new IconButton(ComposantClass.ICONE_AJOUTER);
450
						// TODO : taille du bouton trop grande
449
						bAjouter.addSelectionListener(
451
						bAjouter.addSelectionListener(
450
								new SelectionListener<IconButtonEvent>() {
452
								new SelectionListener<ButtonEvent>() {
451
									public void componentSelected(IconButtonEvent ce) {
453
									public void componentSelected(ButtonEvent ce) {
452
			
454
			
453
										String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue();
455
										String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue();
454
										if ((strTelephone==null)||(strTelephone.trim().equals("")))	{
456
										if ((strTelephone==null)||(strTelephone.trim().equals("")))	{
455
											MessageBox.alert("Erreur de saisie", "Vous devez saisir un numéro de téléphone", null);
457
											MessageBox.alert("Erreur de saisie", "Vous devez saisir un numéro de téléphone", null);
456
										} else if (hmIdentite.get("tel-" + strTelephone) != null){
458
										} else if (hmIdentite.get("tel-" + strTelephone) != null){
457
											MessageBox.alert("Erreur de saisie", "Le numéro saisi est déjà présent dans la liste", null);							
459
											MessageBox.alert("Erreur de saisie", "Le numéro saisi est déjà présent dans la liste", null);							
458
										} else {
460
										} else {
459
												String strValeurTypeTel = "";
461
												String strValeurTypeTel = "";
460
												String idTel = "";
462
												String idTel = "";
461
												Valeur valeurTypeTel = ((ComboBox<Valeur>) hmIdentite.get("cbTelephone")).getValue();
463
												Valeur valeurTypeTel = ((ComboBox<Valeur>) hmIdentite.get("cbTelephone")).getValue();
462
									
464
									
463
												if (valeurTypeTel != null)	{
465
												if (valeurTypeTel != null)	{
464
													strValeurTypeTel = valeurTypeTel.getNom();
466
													strValeurTypeTel = valeurTypeTel.getNom();
465
													idTel = valeurTypeTel.get("abreviation");
467
													idTel = valeurTypeTel.get("abreviation");
466
												}	else {
468
												}	else {
467
													strValeurTypeTel = ((ComboBox<Valeur>) hmIdentite.get("cbTelephone")).getRawValue();
469
													strValeurTypeTel = ((ComboBox<Valeur>) hmIdentite.get("cbTelephone")).getRawValue();
468
													idTel = strValeurTypeTel;
470
													idTel = strValeurTypeTel;
469
												}
471
												}
470
								
472
								
471
												if (strValeurTypeTel.trim().equals(""))	{
473
												if (strValeurTypeTel.trim().equals(""))	{
472
													MessageBox.alert("Erreur de saisie", "Vous devez saisir un type de téléphone", null);
474
													MessageBox.alert("Erreur de saisie", "Vous devez saisir un type de téléphone", null);
473
												}	else {
475
												}	else {
474
													ajouterTelephone(strTelephone, strValeurTypeTel, idTel);
476
													ajouterTelephone(strTelephone, strValeurTypeTel, idTel);
475
												}
477
												}
476
											}
478
											}
477
										}
479
										}
478
									}			
480
									}			
479
								);
481
								);
480
			
482
			
481
						lcTelephone.add(bAjouter, new ColumnData(0.15));
483
						lcTelephone.add(bAjouter, new ColumnData(0.15));
482
						
484
						
483
						HiddenField<String> hfTelephone = new HiddenField<String>();
485
						HiddenField<String> hfTelephone = new HiddenField<String>();
484
						add(hfTelephone);
486
						add(hfTelephone);
485
						hmIdentite.put("hfTelephone", hfTelephone);
487
						hmIdentite.put("hfTelephone", hfTelephone);
486
					
488
					
487
					fsContactTel.add(lcTelephone);
489
					fsContactTel.add(lcTelephone);
488
			
490
			
489
					FieldSet fsContact = new FieldSet();
491
					FieldSet fsContact = new FieldSet();
490
					fsContact.setHeading("Contact - Autres");
492
					fsContact.setHeading("Contact - Autres");
491
					fsContact.setId("fsContact");
493
					fsContact.setId("fsContact");
492
					fsContact.setLayout(new RowLayout());
494
					fsContact.setLayout(new RowLayout());
493
			
495
			
494
					right.add(fsContact);
496
					right.add(fsContact);
495
					hmIdentite.put("fsContact", fsContact);
497
					hmIdentite.put("fsContact", fsContact);
496
			
498
			
497
					LabelField lfCourriel = new LabelField();
499
					LabelField lfCourriel = new LabelField();
498
					lfCourriel.setText("<b>Courriels:</b>");
500
					lfCourriel.setText("<b>Courriels:</b>");
499
			
501
			
500
					fsContact.add(lfCourriel);
502
					fsContact.add(lfCourriel);
501
			
503
			
502
					LayoutContainer lcCourriel = new LayoutContainer();
504
					LayoutContainer lcCourriel = new LayoutContainer();
503
					lcCourriel.setLayout(new ColumnLayout());
505
					lcCourriel.setLayout(new ColumnLayout());
504
			
506
			
505
						TextField tfCourriel = new TextField();
507
						TextField tfCourriel = new TextField();
506
						lcCourriel.add(tfCourriel, new ColumnData(0.80));
508
						lcCourriel.add(tfCourriel, new ColumnData(0.80));
507
						
509
						
508
						HiddenField hfHiddenCourriel = new HiddenField();
510
						HiddenField hfHiddenCourriel = new HiddenField();
509
						hfHiddenCourriel.setId("tfHiddenCourriel");
511
						hfHiddenCourriel.setId("tfHiddenCourriel");
510
						hfHiddenCourriel.setValue("");
512
						hfHiddenCourriel.setValue("");
511
						
513
						
512
						add(hfHiddenCourriel);
514
						add(hfHiddenCourriel);
513
						hmIdentite.put("hfHiddenCourriel", hfHiddenCourriel);
515
						hmIdentite.put("hfHiddenCourriel", hfHiddenCourriel);
514
						hmIdentite.put("tfCourriel", tfCourriel);
516
						hmIdentite.put("tfCourriel", tfCourriel);
515
			
517
			
-
 
518
						Button bAjouterCourriel = new Button();
516
						IconButton bAjouterCourriel = new IconButton(ComposantClass.ICONE_AJOUTER);
519
						bAjouterCourriel.setIcon(Images.ICONES.ajouter());
517
						bAjouterCourriel.addSelectionListener(
520
						bAjouterCourriel.addSelectionListener(
518
								new SelectionListener<IconButtonEvent>() {
521
								new SelectionListener<ButtonEvent>() {
519
						
522
						
520
									public void componentSelected(IconButtonEvent ce) {
523
									public void componentSelected(ButtonEvent ce) {
521
										
524
										
522
										String strEmail = ((TextField<String>) hmIdentite.get("tfCourriel")).getValue();
525
										String strEmail = ((TextField<String>) hmIdentite.get("tfCourriel")).getValue();
523
										if ((strEmail==null)||(strEmail.trim().equals("")))	{
526
										if ((strEmail==null)||(strEmail.trim().equals("")))	{
524
											MessageBox.alert("Erreur de saisie", "Vous devez saisir une adresse", null);
527
											MessageBox.alert("Erreur de saisie", "Vous devez saisir une adresse", null);
525
										} else if (hmIdentite.get("email-" + strEmail) != null){
528
										} else if (hmIdentite.get("email-" + strEmail) != null){
526
											MessageBox.alert("Erreur de saisie", "L'adresse saisie est déjà dans la liste", null);							
529
											MessageBox.alert("Erreur de saisie", "L'adresse saisie est déjà dans la liste", null);							
527
										} else {
530
										} else {
528
											
531
											
529
											if (!strEmail.matches("(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*"))	{
532
											if (!strEmail.matches("(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*"))	{
530
												MessageBox.alert("Erreur de saisie", "L'adresse n'est pas au bon format (ex: me@domain.com)", null);			
533
												MessageBox.alert("Erreur de saisie", "L'adresse n'est pas au bon format (ex: me@domain.com)", null);			
531
											} else if (strEmail.length()>255){
534
											} else if (strEmail.length()>255){
532
												MessageBox.alert("Erreur de saisie", "L'adresse ne peut dépasser 255 caractères", null);
535
												MessageBox.alert("Erreur de saisie", "L'adresse ne peut dépasser 255 caractères", null);
533
											} else {
536
											} else {
534
												ajouterCourriel(strEmail);
537
												ajouterCourriel(strEmail);
535
											}
538
											}
536
											
539
											
537
										}
540
										}
538
										
541
										
539
										
542
										
540
									}
543
									}
541
								});
544
								});
542
			
545
			
543
						lcCourriel.add(bAjouterCourriel, new ColumnData(0.15));
546
						lcCourriel.add(bAjouterCourriel, new ColumnData(0.15));
544
					
547
					
545
					fsContact.add(lcCourriel);
548
					fsContact.add(lcCourriel);
546
			
549
			
547
					LayoutContainer lcCourrielContainer = new LayoutContainer(new RowLayout());
550
					LayoutContainer lcCourrielContainer = new LayoutContainer(new RowLayout());
548
					
551
					
549
					fsContact.add(lcCourrielContainer);
552
					fsContact.add(lcCourrielContainer);
550
					hmIdentite.put("lcCourrielContainer", lcCourrielContainer);
553
					hmIdentite.put("lcCourrielContainer", lcCourrielContainer);
551
			
554
			
552
 
555
 
553
					LabelField lfUrl = new LabelField();
556
					LabelField lfUrl = new LabelField();
554
					lfUrl.setText("<b>Sites Web:</b>");
557
					lfUrl.setText("<b>Sites Web:</b>");
555
					
558
					
556
					fsContact.add(lfUrl);
559
					fsContact.add(lfUrl);
557
			
560
			
558
					LayoutContainer lcUrl = new LayoutContainer(new ColumnLayout());
561
					LayoutContainer lcUrl = new LayoutContainer(new ColumnLayout());
559
					hmIdentite.put("lcUrl", lcUrl);
562
					hmIdentite.put("lcUrl", lcUrl);
560
			
563
			
561
					HiddenField<String> hfUrl = new HiddenField<String>();
564
					HiddenField<String> hfUrl = new HiddenField<String>();
562
					hmIdentite.put("hfUrl", hfUrl);
565
					hmIdentite.put("hfUrl", hfUrl);
563
					add(hfUrl);
566
					add(hfUrl);
564
					
567
					
565
						TextField tfUrl = new TextField();
568
						TextField tfUrl = new TextField();
566
						tfUrl.setValue("http://");
569
						tfUrl.setValue("http://");
567
			
570
			
568
						lcUrl.add(tfUrl, new ColumnData(0.8));
571
						lcUrl.add(tfUrl, new ColumnData(0.8));
569
						hmIdentite.put("tfUrl", tfUrl);
572
						hmIdentite.put("tfUrl", tfUrl);
570
			
573
			
-
 
574
						Button ibAjouterUrl = new Button();
571
						IconButton ibAjouterUrl = new IconButton(ComposantClass.ICONE_AJOUTER);
575
						ibAjouterUrl.setIcon(Images.ICONES.ajouter());
572
						ibAjouterUrl.addSelectionListener(new SelectionListener<IconButtonEvent>() {
576
						ibAjouterUrl.addSelectionListener(new SelectionListener<ButtonEvent>() {
573
 
577
 
574
							public void componentSelected(IconButtonEvent ce) {
578
							public void componentSelected(ButtonEvent ce) {
575
								
579
								
576
								TextField<String> tfUrl = (TextField) hmIdentite.get("tfUrl");
580
								TextField<String> tfUrl = (TextField) hmIdentite.get("tfUrl");
577
								String strUrl = tfUrl.getValue();
581
								String strUrl = tfUrl.getValue();
578
								
582
								
579
								if ((strUrl == null)||(strUrl.trim().equals("http://"))||(strUrl.trim().equals("")))	{
583
								if ((strUrl == null)||(strUrl.trim().equals("http://"))||(strUrl.trim().equals("")))	{
580
									MessageBox.alert("Erreur de saisie", "Vous devez saisir un URL", null);
584
									MessageBox.alert("Erreur de saisie", "Vous devez saisir un URL", null);
581
								} else if(hmIdentite.get("url-" + strUrl) != null)	{
585
								} else if(hmIdentite.get("url-" + strUrl) != null)	{
582
									MessageBox.alert("Erreur de saisie", "L'url est déjà présente dans la liste.", null);
586
									MessageBox.alert("Erreur de saisie", "L'url est déjà présente dans la liste.", null);
583
								}	else	{
587
								}	else	{
584
									tfUrl.setValue("");
588
									tfUrl.setValue("http://");
585
										//if (!strUrl.matches("[a-z]{3,}://[a-z0-9-]+.[.a-z0-9-]+(?::[0-9]*)?"))	{
589
										//if (!strUrl.matches("[a-z]{3,}://[a-z0-9-]+.[.a-z0-9-]+(?::[0-9]*)?"))	{
586
										if (!strUrl.startsWith("http://"))	{	
590
										if (!strUrl.startsWith("http://"))	{	
587
											MessageBox.alert("Erreur de saisie", "L'adresse n'est pas au bon format (ex: http://www.domain.com)", null);			
591
											MessageBox.alert("Erreur de saisie", "L'adresse n'est pas au bon format (ex: http://www.domain.com)", null);			
588
										} else if (strUrl.length()>255){
592
										} else if (strUrl.length()>255){
589
											MessageBox.alert("Erreur de saisie", "L'adresse ne peut dépasser 255 caractères", null);
593
											MessageBox.alert("Erreur de saisie", "L'adresse ne peut dépasser 255 caractères", null);
590
										} else {
594
										} else {
591
											ajouterUrl(strUrl);
595
											ajouterUrl(strUrl);
592
										}
596
										}
593
									
597
									
594
								}
598
								}
595
								
599
								
596
							}
600
							}
597
						});
601
						});
598
			
602
			
599
						lcUrl.add(ibAjouterUrl, new ColumnData(0.15));
603
						lcUrl.add(ibAjouterUrl, new ColumnData(0.15));
600
					fsContact.add(lcUrl);
604
					fsContact.add(lcUrl);
601
			
605
			
602
					LayoutContainer lcUrlContainer = new LayoutContainer(new RowLayout());
606
					LayoutContainer lcUrlContainer = new LayoutContainer(new RowLayout());
603
					
607
					
604
					fsContact.add(lcUrlContainer);
608
					fsContact.add(lcUrlContainer);
605
					hmIdentite.put("lcUrlContainer", lcUrlContainer);
609
					hmIdentite.put("lcUrlContainer", lcUrlContainer);
606
 
610
 
607
					FieldSet fsAutresInfos = new FieldSet();
611
					FieldSet fsAutresInfos = new FieldSet();
608
					fsAutresInfos.setHeading("Autres informations");
612
					fsAutresInfos.setHeading("Autres informations");
609
			
613
			
610
					formLayout = new FormLayout();
614
					formLayout = new FormLayout();
611
					formLayout.setLabelAlign(LabelAlign.LEFT);
615
					formLayout.setLabelAlign(LabelAlign.LEFT);
612
					fsAutresInfos.setLayout(formLayout); 
616
					fsAutresInfos.setLayout(formLayout); 
613
			
617
			
614
				
618
				
615
			formLayout = new FormLayout();
619
			formLayout = new FormLayout();
616
			formLayout.setLabelAlign(LabelAlign.TOP);
620
			formLayout.setLabelAlign(LabelAlign.TOP);
617
			LayoutContainer lcAutreInformations1 = new LayoutContainer(formLayout);
621
			LayoutContainer lcAutreInformations1 = new LayoutContainer(formLayout);
618
								
622
								
619
			//Civilité				
623
			//Civilité				
620
			ListStore<Valeur> storeSexe = new ListStore<Valeur>();
624
			ListStore<Valeur> storeSexe = new ListStore<Valeur>();
621
			ComboBox<Valeur> cbSexe = new ComboBox<Valeur>();
625
			ComboBox<Valeur> cbSexe = new ComboBox<Valeur>();
622
			cbSexe.setStore(storeSexe);
626
			cbSexe.setStore(storeSexe);
623
			cbSexe.setFieldLabel("Sexe");
627
			cbSexe.setFieldLabel("Sexe");
624
			cbSexe.setDisplayField("nom");
628
			cbSexe.setDisplayField("nom");
625
			cbSexe.setEmptyText("Choisissez le sexe:");
629
			cbSexe.setEmptyText("Choisissez le sexe:");
626
		
630
		
627
			lcAutreInformations1.add(cbSexe, fd100);			
631
			lcAutreInformations1.add(cbSexe, fd100);			
628
			hmIdentite.put("cbSexe", cbSexe);
632
			hmIdentite.put("cbSexe", cbSexe);
629
		
633
		
630
			mediateur.obtenirListeValeurEtRafraichir(this, "sexe");			
634
			mediateur.obtenirListeValeurEtRafraichir(this, "sexe");			
631
			
635
			
632
			//Description
636
			//Description
633
			TextArea taDescription = new TextArea();
637
			TextArea taDescription = new TextArea();
634
			taDescription.setEmptyText("Saisissez une description");
638
			taDescription.setEmptyText("Saisissez une description");
635
			taDescription.setFieldLabel("Description");
639
			taDescription.setFieldLabel("Description");
636
			taDescription.setWidth("100%");
640
			taDescription.setWidth("100%");
637
			taDescription.setName("description");
641
			taDescription.setName("description");
638
			
642
			
639
			lcAutreInformations1.add(taDescription, fd100);
643
			lcAutreInformations1.add(taDescription, fd100);
640
			hmIdentite.put("taDescription", taDescription);
644
			hmIdentite.put("taDescription", taDescription);
641
			
645
			
642
			fsAutresInfos.add(lcAutreInformations1);
646
			fsAutresInfos.add(lcAutreInformations1);
643
			
647
			
644
			// Logo
648
			// Logo
645
			LayoutContainer lcAutreInformations2 = new LayoutContainer();
649
			LayoutContainer lcAutreInformations2 = new LayoutContainer();
646
			hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
650
			hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
647
			
651
			
648
			LabelField lfUrlLogo = new LabelField();
652
			LabelField lfUrlLogo = new LabelField();
649
			lfUrlLogo.setText("<b>Logo:</b>");
653
			lfUrlLogo.setText("<b>Logo:</b>");
650
			lcAutreInformations2.add(lfUrlLogo);
654
			lcAutreInformations2.add(lfUrlLogo);
651
			
655
			
652
			LayoutContainer lcUrlLogo = new LayoutContainer(new ColumnLayout());
656
			LayoutContainer lcUrlLogo = new LayoutContainer(new ColumnLayout());
653
			hmIdentite.put("lcUrlLogo", lcUrlLogo);
657
			hmIdentite.put("lcUrlLogo", lcUrlLogo);
654
	
658
	
655
				TextField tfUrlLogo = new TextField();
659
				TextField tfUrlLogo = new TextField();
656
				tfUrlLogo.setValue("http://");
660
				tfUrlLogo.setValue("http://");
657
				
661
				
658
				HiddenField<String> hfUrlLogo = new HiddenField<String>();
662
				HiddenField<String> hfUrlLogo = new HiddenField<String>();
659
				hmIdentite.put("hfUrlLogo", hfUrlLogo);
663
				hmIdentite.put("hfUrlLogo", hfUrlLogo);
660
	
664
	
661
				lcUrlLogo.add(tfUrlLogo, new ColumnData(0.8));
665
				lcUrlLogo.add(tfUrlLogo, new ColumnData(0.8));
662
				hmIdentite.put("tfUrlLogo", tfUrlLogo);
666
				hmIdentite.put("tfUrlLogo", tfUrlLogo);
663
	
667
	
-
 
668
				Button ibAjouterUrlLogo = new Button();
664
				IconButton ibAjouterUrlLogo = new IconButton(ComposantClass.ICONE_AJOUTER);
669
				ibAjouterUrlLogo.setIcon(Images.ICONES.ajouter());
665
				ibAjouterUrlLogo.addSelectionListener(new SelectionListener<IconButtonEvent>() {
670
				ibAjouterUrlLogo.addSelectionListener(new SelectionListener<ButtonEvent>() {
666
 
671
 
667
					public void componentSelected(IconButtonEvent ce) {
672
					public void componentSelected(ButtonEvent ce) {
668
						
673
						
669
						TextField<String> tfUrlLogo = (TextField) hmIdentite.get("tfUrlLogo");
674
						TextField<String> tfUrlLogo = (TextField) hmIdentite.get("tfUrlLogo");
670
						String strUrl = tfUrlLogo.getValue();
675
						String strUrl = tfUrlLogo.getValue();
671
						
676
						
672
						if ((strUrl == null)||(strUrl.trim().equals("http://"))||(strUrl.trim().equals("")))	{
677
						if ((strUrl == null)||(strUrl.trim().equals("http://"))||(strUrl.trim().equals("")))	{
673
							MessageBox.alert("Erreur de saisie", "Vous devez saisir un URL", null);
678
							MessageBox.alert("Erreur de saisie", "Vous devez saisir un URL", null);
674
						} else if(hmIdentite.get("url-" + strUrl) != null)	{
679
						} else if(hmIdentite.get("url-" + strUrl) != null)	{
675
							MessageBox.alert("Erreur de saisie", "L'url est déjà présente dans la liste.", null);
680
							MessageBox.alert("Erreur de saisie", "L'url est déjà présente dans la liste.", null);
676
						}	else	{
681
						}	else	{
677
							tfUrlLogo.setValue("");
682
							tfUrlLogo.setValue("http://");
678
							//if (!strUrl.matches("[a-z]{3,}://[a-z0-9-]+.[.a-z0-9-]+(?::[0-9]*)?"))	{
683
							//if (!strUrl.matches("[a-z]{3,}://[a-z0-9-]+.[.a-z0-9-]+(?::[0-9]*)?"))	{
679
							if (!strUrl.startsWith("http://"))	{
684
							if (!strUrl.startsWith("http://"))	{
680
									MessageBox.alert("Erreur de saisie", "L'adresse n'est pas au bon format (ex: http://www.domain.com)", null);			
685
									MessageBox.alert("Erreur de saisie", "L'adresse n'est pas au bon format (ex: http://www.domain.com)", null);			
681
								} else if (strUrl.length()>255){
686
								} else if (strUrl.length()>255){
682
									MessageBox.alert("Erreur de saisie", "L'adresse ne peut dépasser 255 caractères", null);
687
									MessageBox.alert("Erreur de saisie", "L'adresse ne peut dépasser 255 caractères", null);
683
								} else {
688
								} else {
684
									ajouterUrlLogo(strUrl);
689
									ajouterUrlLogo(strUrl);
685
								}
690
								}
686
							
691
							
687
						}
692
						}
688
						
693
						
689
					}
694
					}
690
				});
695
				});
691
	
696
	
692
				lcUrlLogo.add(ibAjouterUrlLogo, new ColumnData(0.15));
697
				lcUrlLogo.add(ibAjouterUrlLogo, new ColumnData(0.15));
693
				lcAutreInformations2.add(lcUrlLogo);
698
				lcAutreInformations2.add(lcUrlLogo);
694
			
699
			
695
			fsAutresInfos.add(lcAutreInformations2);
700
			fsAutresInfos.add(lcAutreInformations2);
696
			
701
			
697
			TextArea taLogo = new TextArea();
702
			TextArea taLogo = new TextArea();
698
			taLogo.setFieldLabel("Logos");
703
			taLogo.setFieldLabel("Logos");
699
			taLogo.setWidth("100%");
704
			taLogo.setWidth("100%");
700
			taLogo.setEmptyText("Saisissez les adresses des logos séparées par un saut de ligne");
705
			taLogo.setEmptyText("Saisissez les adresses des logos séparées par un saut de ligne");
701
			//fsAutresInfos.add(taLogo, fd100);
706
			//fsAutresInfos.add(taLogo, fd100);
702
			
707
			
703
			hmIdentite.put("taLogo", taLogo);
708
			hmIdentite.put("taLogo", taLogo);
704
			
709
			
705
			right.add(fsAutresInfos);
710
			right.add(fsAutresInfos);
706
			
711
			
707
			// Ajout des évènements saisi
712
			// Ajout des évènements saisi
708
			KeyListener klNoms = new KeyListener()	{
713
			KeyListener klNoms = new KeyListener()	{
709
				public void componentKeyUp(ComponentEvent ev)	{
714
				public void componentKeyUp(ComponentEvent ev)	{
710
					rafraichir(null);	
715
					rafraichir(null);	
711
				}				
716
				}				
712
			};
717
			};
713
			
718
			
714
			SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
719
			SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
715
				public void selectionChanged(SelectionChangedEvent se) {
720
				public void selectionChanged(SelectionChangedEvent se) {
716
						rafraichir(null);
721
						rafraichir(null);
717
					}
722
					}
718
			};
723
			};
719
						
724
						
720
			cbPrefixe.addSelectionChangedListener(selectionChange);
725
			cbPrefixe.addSelectionChangedListener(selectionChange);
721
			cbPrefixe.addKeyListener(klNoms);
726
			cbPrefixe.addKeyListener(klNoms);
722
			tfPrenom.addKeyListener(klNoms);
727
			tfPrenom.addKeyListener(klNoms);
723
			tfNom.addKeyListener(klNoms);
728
			tfNom.addKeyListener(klNoms);
724
			cbSuffixe.addSelectionChangedListener(selectionChange);		
729
			cbSuffixe.addSelectionChangedListener(selectionChange);		
725
			
730
			
726
	}
731
	}
727
	
732
	
728
	public void creerComposantsAdresse()	{
733
	public void creerComposantsAdresse()	{
729
		
734
		
730
		// Gauche
735
		// Gauche
731
		LayoutContainer left = new LayoutContainer();
736
		LayoutContainer left = new LayoutContainer();
732
		left.setLayout(new FormLayout());
737
		left.setLayout(new FormLayout());
733
		
738
		
734
		// Droite
739
		// Droite
735
		LayoutContainer right = new LayoutContainer();
740
		LayoutContainer right = new LayoutContainer();
736
		right.setLayout(new FormLayout());
741
		right.setLayout(new FormLayout());
737
		
742
		
738
		// Principal
743
		// Principal
739
		LayoutContainer main = new LayoutContainer();
744
		LayoutContainer main = new LayoutContainer();
740
		main.setLayout(new ColumnLayout());
745
		main.setLayout(new ColumnLayout());
741
		
746
		
742
		// Ajout au principal
747
		// Ajout au principal
743
		main.add(left, new ColumnData(.49));
748
		main.add(left, new ColumnData(.49));
744
		main.add(right, new ColumnData(.49));	
749
		main.add(right, new ColumnData(.49));	
745
		
750
		
746
		TextField<String> tfAdresse1 = new TextField();
751
		TextField<String> tfAdresse1 = new TextField();
747
		tfAdresse1.setFieldLabel("Adresse");
752
		tfAdresse1.setFieldLabel("Adresse");
748
		tfAdresse1.setName("adresse_01");
753
		tfAdresse1.setName("adresse_01");
749
		left.add(tfAdresse1, fd100);
754
		left.add(tfAdresse1, fd100);
750
		hmAdresse.put("tfAdresse1", tfAdresse1);
755
		hmAdresse.put("tfAdresse1", tfAdresse1);
751
		
756
		
752
		TextField<String> tfAdresse2 = new TextField();
757
		TextField<String> tfAdresse2 = new TextField();
753
		tfAdresse2.setFieldLabel("Complément d'adresse");
758
		tfAdresse2.setFieldLabel("Complément d'adresse");
754
		tfAdresse2.setName("adresse_02");
759
		tfAdresse2.setName("adresse_02");
755
		left.add(tfAdresse2, fd100);
760
		left.add(tfAdresse2, fd100);
756
		hmAdresse.put("tfAdresse2", tfAdresse2);
761
		hmAdresse.put("tfAdresse2", tfAdresse2);
757
		
762
		
758
		ComboBox<Valeur> cbPays = new ComboBox<Valeur>();
763
		ComboBox<Valeur> cbPays = new ComboBox<Valeur>();
759
		cbPays.setFieldLabel("Pays");
764
		cbPays.setFieldLabel("Pays");
760
		cbPays.setDisplayField("nom");
765
		cbPays.setDisplayField("nom");
761
		cbPays.setEmptyText("Sélectionnez le pays:");
766
		cbPays.setEmptyText("Sélectionnez le pays:");
762
		
767
		
763
		ListStore<Valeur> storePays = new ListStore<Valeur>();
768
		ListStore<Valeur> storePays = new ListStore<Valeur>();
764
		cbPays.setStore(storePays);
769
		cbPays.setStore(storePays);
765
		
770
		
766
		right.add(cbPays, fd100);
771
		right.add(cbPays, fd100);
767
		hmAdresse.put("cbPays", cbPays);
772
		hmAdresse.put("cbPays", cbPays);
768
		
773
		
769
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
774
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
770
			public void selectionChanged(SelectionChangedEvent se) {
775
			public void selectionChanged(SelectionChangedEvent se) {
771
					// Rafraichir avec le pays sélectionné
776
					// Rafraichir avec le pays sélectionné
772
					obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
777
					obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
773
					
778
					
774
				}
779
				}
775
		};
780
		};
776
					
781
					
777
		cbPays.addSelectionChangedListener(selectionChange);
782
		cbPays.addSelectionChangedListener(selectionChange);
778
		
783
		
779
		
784
		
780
		ComboBox<Valeur> cbRegion = new ComboBox<Valeur>();
785
		ComboBox<Valeur> cbRegion = new ComboBox<Valeur>();
781
		cbRegion.setFieldLabel("Region");
786
		cbRegion.setFieldLabel("Region");
782
		cbRegion.setDisplayField("nom");
787
		cbRegion.setDisplayField("nom");
783
		cbRegion.setEmptyText("Sélectionnez la région:");
788
		cbRegion.setEmptyText("Sélectionnez la région:");
784
		cbRegion.setVisible(false);
789
		cbRegion.setVisible(false);
785
		
790
		
786
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
791
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
787
		cbRegion.setStore(storeRegion);
792
		cbRegion.setStore(storeRegion);
788
		
793
		
789
		
794
		
790
		right.add(cbRegion, fd100);
795
		right.add(cbRegion, fd100);
791
		hmAdresse.put("cbRegion", cbRegion);
796
		hmAdresse.put("cbRegion", cbRegion);
792
		
797
		
793
		TextField<String> tfBoitePostale = new TextField<String>();
798
		TextField<String> tfBoitePostale = new TextField<String>();
794
		tfBoitePostale.setFieldLabel("Boite postale");
799
		tfBoitePostale.setFieldLabel("Boite postale");
795
		tfBoitePostale.setName("bp");
800
		tfBoitePostale.setName("bp");
796
		
801
		
797
		left.add(tfBoitePostale, fd100);
802
		left.add(tfBoitePostale, fd100);
798
		hmAdresse.put("tfBoitePostale", tfBoitePostale);
803
		hmAdresse.put("tfBoitePostale", tfBoitePostale);
799
		
804
		
800
		TextField<Integer> tfCodePostal = new TextField<Integer>();
805
		TextField<Integer> tfCodePostal = new TextField<Integer>();
801
		tfCodePostal.setFieldLabel("Code postal");
806
		tfCodePostal.setFieldLabel("Code postal");
802
		tfCodePostal.setName("code_postal");
807
		tfCodePostal.setName("code_postal");
803
		
808
		
804
		right.add(tfCodePostal, fd100);
809
		right.add(tfCodePostal, fd100);
805
		hmAdresse.put("tfCodePostal", tfCodePostal);
810
		hmAdresse.put("tfCodePostal", tfCodePostal);
806
		
811
		
807
		TextField tfVille = new TextField();
812
		TextField tfVille = new TextField();
808
		tfVille.setFieldLabel("Ville");
813
		tfVille.setFieldLabel("Ville");
809
		tfVille.setName("ville");
814
		tfVille.setName("ville");
810
		
815
		
811
		right.add(tfVille, fd100);
816
		right.add(tfVille, fd100);
812
		hmAdresse.put("tfVille", tfVille);
817
		hmAdresse.put("tfVille", tfVille);
813
		
818
		
814
		// MAJ ComboBox
819
		// MAJ ComboBox
815
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
820
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
816
		
821
		
817
		FieldSet fsAdresse = new FieldSet();
822
		FieldSet fsAdresse = new FieldSet();
818
		fsAdresse.setHeading("Adresse personnelle");
823
		fsAdresse.setHeading("Adresse personnelle");
819
		fsAdresse.add(main);
824
		fsAdresse.add(main);
820
		
825
		
821
		tiAdresses.add(fsAdresse);
826
		tiAdresses.add(fsAdresse);
822
		((ComboBox) hmIdentite.get("cbPrefixe")).setRawValue("ljkhlkj");
827
		((ComboBox) hmIdentite.get("cbPrefixe")).setRawValue("ljkhlkj");
823
	}
828
	}
824
		
829
		
825
	/**
830
	/**
826
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
831
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
827
	 * 
832
	 * 
828
	 * @param barreOutils la barre d'outils à modifier
833
	 * @param barreOutils la barre d'outils à modifier
829
	 * */
834
	 * */
830
	public void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
835
	public void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
831
		
836
		
832
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
837
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
833
		Button reinitialiser = new Button("Réinitialiser le formulaire");
838
		Button reinitialiser = new Button("Réinitialiser le formulaire");
834
		reinitialiser.setIcon(Images.ICONES.rafraichir());
839
		reinitialiser.setIcon(Images.ICONES.rafraichir());
835
		reinitialiser.addSelectionListener(new SelectionListener<ButtonEvent>() {  
840
		reinitialiser.addSelectionListener(new SelectionListener<ButtonEvent>() {  
836
			public void componentSelected(ButtonEvent ce) {  
841
			public void componentSelected(ButtonEvent ce) {  
837
				//((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
842
				//((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
838
				reinitialiser();
843
				reinitialiser();
839
			}  
844
			}  
840
		});
845
		});
841
		barreOutils.add(reinitialiser);
846
		barreOutils.add(reinitialiser);
842
	}
847
	}
843
	
848
	
844
	/**
849
	/**
845
	 * Ajouter le bouton Sauvegarder et revenir à la liste à la barre d'outils donnée
850
	 * Ajouter le bouton Sauvegarder et revenir à la liste à la barre d'outils donnée
846
	 * 
851
	 * 
847
	 * @param barreOutils la barre d'outils à modifier
852
	 * @param barreOutils la barre d'outils à modifier
848
	 * */
853
	 * */
849
	private void ajouterBoutonEnregistrerEtRevenir(ButtonBar barreOutils)	{
854
	private void ajouterBoutonEnregistrerEtRevenir(ButtonBar barreOutils)	{
850
		
855
		
851
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
856
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
852
		Button enregistrer = new Button("Enregistrer et revenir à la liste");
857
		Button enregistrer = new Button("Enregistrer et revenir à la liste");
853
		enregistrer.setIcon(Images.ICONES.scriptGo());
858
		enregistrer.setIcon(Images.ICONES.scriptGo());
854
		enregistrer.setIconAlign(IconAlign.LEFT);
859
		enregistrer.setIconAlign(IconAlign.LEFT);
855
		enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {  
860
		enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {  
856
			public void componentSelected(ButtonEvent ce) {  
861
			public void componentSelected(ButtonEvent ce) {  
857
				
-
 
-
 
862
				enregistrer();
858
			}  
863
			}  
859
		});
864
		});
860
		enregistrer.setEnabled(false);
865
		enregistrer.setEnabled(false);
861
		
866
		
862
		hmIdentite.put("btnEnregistrerRevenir", enregistrer);
867
		hmIdentite.put("btnEnregistrerRevenir", enregistrer);
863
		barreOutils.add(enregistrer);
868
		barreOutils.add(enregistrer);
864
		
869
		
865
	}
870
	}
866
	
871
	
867
	/**
872
	/**
868
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
873
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
869
	 * 
874
	 * 
870
	 * @param barreOutils la barre d'outils à modifier
875
	 * @param barreOutils la barre d'outils à modifier
871
	 * */
876
	 * */
872
	private void ajouterBoutonEnregistrer(ButtonBar barreOutils)	{
877
	private void ajouterBoutonEnregistrer(ButtonBar barreOutils)	{
873
		
878
		
874
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
879
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
875
		Button enregistrer = new Button("Enregistrer");
880
		Button enregistrer = new Button("Enregistrer");
876
		enregistrer.setIcon(Images.ICONES.scriptSave());
881
		enregistrer.setIcon(Images.ICONES.scriptSave());
877
		enregistrer.setIconAlign(IconAlign.LEFT);
882
		enregistrer.setIconAlign(IconAlign.LEFT);
878
		enregistrer.setId("main-button");
883
		enregistrer.setId("main-button");
879
		enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {  
884
		enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {  
880
			public void componentSelected(ButtonEvent ce) {  
885
			public void componentSelected(ButtonEvent ce) {  
881
				enregistrer();
886
				enregistrer();
882
			}  
887
			}  
883
		});
888
		});
884
		enregistrer.setEnabled(false);
889
		enregistrer.setEnabled(false);
885
		
890
		
886
		hmIdentite.put("btnEnregistrer", enregistrer);
891
		hmIdentite.put("btnEnregistrer", enregistrer);
887
		barreOutils.add(enregistrer);
892
		barreOutils.add(enregistrer);
888
	}
893
	}
889
	
894
	
890
	/**
895
	/**
891
	 * Ajouter le bouton annuler à la barre d'outils donnée
896
	 * Ajouter le bouton annuler à la barre d'outils donnée
892
	 * 
897
	 * 
893
	 * @param barreOutils la barre d'outils à modifier
898
	 * @param barreOutils la barre d'outils à modifier
894
	 * */
899
	 * */
895
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
900
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
896
		
901
		
897
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
902
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
898
		Button annuler = new Button("Revenir à la liste");
903
		Button annuler = new Button("Revenir à la liste");
899
		annuler.addSelectionListener(new SelectionListener<ButtonEvent>() {  
904
		annuler.addSelectionListener(new SelectionListener<ButtonEvent>() {  
900
			public void componentSelected(ButtonEvent ce) {  
905
			public void componentSelected(ButtonEvent ce) {  
901
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
906
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
902
			}  
907
			}  
903
		});
908
		});
904
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
909
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
905
		barreOutils.add(annuler);
910
		barreOutils.add(annuler);
906
	}
911
	}
907
	
912
	
908
	public void obtenirListeRegionParPays(String strPays)	{
913
	public void obtenirListeRegionParPays(String strPays)	{
909
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
914
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
910
	}
915
	}
911
	
916
	
912
	
917
	
913
	
918
	
914
	/*---------------------------------------------------------------------------------------
919
	/*---------------------------------------------------------------------------------------
915
	 * 		RAFRAICHISSEMENT DU PANNEAU
920
	 * 		RAFRAICHISSEMENT DU PANNEAU
916
	 * --------------------------------------------------------------------------------------
921
	 * --------------------------------------------------------------------------------------
917
	 */	
922
	 */	
918
	public void rafraichir(Object nouvellesDonnees) {
923
	public void rafraichir(Object nouvellesDonnees) {
919
		
924
		
920
		
925
		
921
		
926
		
922
		if (nouvellesDonnees instanceof ValeurListe) {
927
		if (nouvellesDonnees instanceof ValeurListe) {
923
			
928
			
924
			
929
			
925
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
930
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
926
			
931
			
927
			// Créer une liste de valeurs
932
			// Créer une liste de valeurs
928
			List<Valeur> liste = new ArrayList<Valeur>();
933
			List<Valeur> liste = new ArrayList<Valeur>();
929
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
934
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
930
				liste.add(listeValeurs.get(it.next()));
935
				liste.add(listeValeurs.get(it.next()));
931
			}
936
			}
932
			
937
			
933
			if (listeValeurs.getId().equals(config.getListeId("prefixe")))	{
938
			if (listeValeurs.getId().equals(config.getListeId("prefixe")))	{
934
 
939
 
935
				remplirCombobox("cbPrefixe", liste, "hmIdentite");
940
				remplirCombobox("cbPrefixe", liste, "hmIdentite");
936
								
941
								
937
			} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) {
942
			} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) {
938
			
943
			
939
				remplirCombobox("cbSuffixe", liste, "hmIdentite");
944
				remplirCombobox("cbSuffixe", liste, "hmIdentite");
940
								
945
								
941
			} else if (listeValeurs.getId().equals(config.getListeId("sexe"))) {
946
			} else if (listeValeurs.getId().equals(config.getListeId("sexe"))) {
942
 
947
 
943
				remplirCombobox("cbSexe", liste, "hmIdentite");
948
				remplirCombobox("cbSexe", liste, "hmIdentite");
944
				
949
				
945
			} else if (listeValeurs.getId().equals(config.getListeId("tel"))) {
950
			} else if (listeValeurs.getId().equals(config.getListeId("tel"))) {
946
			
951
			
947
				remplirCombobox("cbTelephone", liste, "hmIdentite");
952
				remplirCombobox("cbTelephone", liste, "hmIdentite");
948
				
953
				
949
				//Préselection du tél
954
				//Préselection du tél
950
				ComboBox<Valeur> cbTelephone = (ComboBox<Valeur>) hmIdentite.get("cbTelephone");
955
				ComboBox<Valeur> cbTelephone = (ComboBox<Valeur>) hmIdentite.get("cbTelephone");
951
				cbTelephone.setValue(liste.get(1));
956
				cbTelephone.setValue(liste.get(1));
952
			
957
			
953
			} else if (listeValeurs.getId().equals(config.getListeId("pays")))	{
958
			} else if (listeValeurs.getId().equals(config.getListeId("pays")))	{
954
				
959
				
955
				remplirCombobox("cbPays", liste, "hmAdresse");
960
				remplirCombobox("cbPays", liste, "hmAdresse");
956
				
961
				
957
			} else if (listeValeurs.getId().equals(config.getListeId("region")))	{
962
			} else if (listeValeurs.getId().equals(config.getListeId("region")))	{
958
				
963
				
959
				remplirCombobox("cbRegion", liste, "hmAdresse");
964
				remplirCombobox("cbRegion", liste, "hmAdresse");
960
				
965
				
961
				((ComboBox) hmAdresse.get("cbRegion")).setVisible(true);
966
				((ComboBox) hmAdresse.get("cbRegion")).setVisible(true);
962
			}
967
			}
963
			
968
			
964
			
969
			
965
		} else if (nouvellesDonnees instanceof ProjetListe) {
970
		} else if (nouvellesDonnees instanceof ProjetListe) {
966
			
971
			
967
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
972
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
968
			
973
			
969
			List<Projet> liste = new ArrayList<Projet>();
974
			List<Projet> liste = new ArrayList<Projet>();
970
			for (Iterator<String> it = projets.keySet().iterator(); it.hasNext();) {
975
			for (Iterator<String> it = projets.keySet().iterator(); it.hasNext();) {
971
				liste.add(projets.get(it.next()));
976
				liste.add(projets.get(it.next()));
972
			}
977
			}
973
			ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
978
			ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
974
			ListStore<Projet> storeProjets= cbProjets.getStore();
979
			ListStore<Projet> storeProjets= cbProjets.getStore();
975
			storeProjets.removeAll();
980
			storeProjets.removeAll();
976
			storeProjets.add(liste);
981
			storeProjets.add(liste);
977
			cbProjets.setStore(storeProjets);
982
			cbProjets.setStore(storeProjets);
978
			
983
			
979
		} else if (nouvellesDonnees instanceof Information)	{
984
		} else if (nouvellesDonnees instanceof Information)	{
980
			
985
			
981
			Information info = (Information) nouvellesDonnees;
986
			Information info = (Information) nouvellesDonnees;
982
			if (info.getType().equals("ajout_personne"))	{
987
			if (info.getType().equals("ajout_personne"))	{
983
				
988
				
984
				GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null);
989
				GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null);
985
				Info.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")");
990
				Info.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")");
986
				
991
				
987
				personneSelectionnee.set("id_personne", info.toString());
992
				personneSelectionnee.set("id_personne", info.toString());
988
				this.mode = MODE_MODIFIER;
993
				this.mode = MODE_MODIFIER;
989
				this.setHeading(mediateur.i18nC.personneModeModifier());
994
				this.setHeading(mediateur.i18nC.personneModeModifier());
990
				setIcon(Images.ICONES.formModifier());
995
				setIcon(Images.ICONES.formModifier());
991
				
996
				
992
			} else if (info.getType().equals("modification_personne"))	{
997
			} else if (info.getType().equals("modification_personne"))	{
993
				
998
				
994
				Info.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
999
				Info.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
995
				
1000
				
996
			} else if (info.getDonnee(0) instanceof PersonneListe)	{
1001
			} else if (info.getDonnee(0) instanceof PersonneListe)	{
997
			
1002
			
998
			
1003
			
999
					Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
1004
					Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
1000
					Iterator itPersonneListe = colPersonneListe.iterator();
1005
					Iterator itPersonneListe = colPersonneListe.iterator();
1001
					Personne personne = (Personne) itPersonneListe.next();
1006
					Personne personne = (Personne) itPersonneListe.next();
1002
					
1007
					
1003
					personneSauvegarde = new Personne();
1008
					personneSauvegarde = new Personne();
1004
					personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
1009
					personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
1005
					
1010
					
1006
					binderPersonne(personne);
1011
					binderPersonne(personne);
1007
					//Mise à jour de la personne		
1012
					//Mise à jour de la personne		
1008
					//Personne personne = (Personne) nouvellesDonnees;
1013
					//Personne personne = (Personne) nouvellesDonnees;
1009
					
1014
					
1010
					ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
1015
					ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
1011
					cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
1016
					cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
1012
					
1017
					
1013
					//Prefixe
1018
					//Prefixe
1014
					String prefixe = personne.get("ce_truk_prefix");
1019
					String prefixe = personne.get("ce_truk_prefix");
1015
					ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
1020
					ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
1016
					
1021
					
1017
					
1022
					
1018
					String prefixeCourant = personne.get("ce_truk_prefix");
1023
					String prefixeCourant = personne.get("ce_truk_prefix");
1019
					if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null)	{
1024
					if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null)	{
1020
						cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
1025
						cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
1021
					}	else	{
1026
					}	else	{
1022
						cbPrefixe.setRawValue(prefixeCourant);
1027
						cbPrefixe.setRawValue(prefixeCourant);
1023
					}
1028
					}
1024
					
1029
					
1025
					
1030
					
1026
					((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
1031
					((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
1027
					((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
1032
					((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
1028
					
1033
					
1029
					//Suffixe
1034
					//Suffixe
1030
					String suffixe = personne.get("ce_truk_suffixe");
1035
					String suffixe = personne.get("ce_truk_suffixe");
1031
					ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe");
1036
					ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe");
1032
					
1037
					
1033
					String suffixeCourant = personne.get("ce_truk_suffix");
1038
					String suffixeCourant = personne.get("ce_truk_suffix");
1034
					if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null)	{
1039
					if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null)	{
1035
						cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
1040
						cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
1036
					}	else	{
1041
					}	else	{
1037
						cbSuffixe.setRawValue(suffixeCourant);
1042
						cbSuffixe.setRawValue(suffixeCourant);
1038
					}
1043
					}
1039
					
1044
					
1040
					((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
1045
					((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
1041
					((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
1046
					((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
1042
					((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
1047
					((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
1043
					
1048
					
1044
					
1049
					
1045
					(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date"));
1050
					(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date"));
1046
					((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
1051
					((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
1047
					
1052
					
1048
					(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date"));
1053
					(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date"));
1049
					((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu"));
1054
					((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu"));
1050
					
1055
					
1051
					
1056
					
1052
					// Telephone
1057
					// Telephone
1053
					HashMap<String, String> hmTelephone = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_telephone");
1058
					HashMap<String, String> hmTelephone = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_telephone");
1054
					if (hmTelephone!=null)	{
1059
					if (hmTelephone!=null)	{
1055
						
1060
						
1056
						ListStore storeTelephone = ((ComboBox) hmIdentite.get("cbTelephone")).getStore();
1061
						ListStore storeTelephone = ((ComboBox) hmIdentite.get("cbTelephone")).getStore();
1057
						List lstModelsTelephone = storeTelephone.getModels();
1062
						List lstModelsTelephone = storeTelephone.getModels();
1058
						Iterator<Valeur> itStore = lstModelsTelephone.iterator();
1063
						Iterator<Valeur> itStore = lstModelsTelephone.iterator();
1059
						HashMap<String, String> hmTel = new HashMap();
1064
						HashMap<String, String> hmTel = new HashMap();
1060
						while (itStore.hasNext())	{
1065
						while (itStore.hasNext())	{
1061
							Valeur v = itStore.next();
1066
							Valeur v = itStore.next();
1062
							hmTel.put(v.getAbreviation(), v.getNom());
1067
							hmTel.put(v.getAbreviation(), v.getNom());
1063
						}
1068
						}
1064
						
1069
						
1065
						Collection<String> colTelephone = hmTelephone.keySet();
1070
						Collection<String> colTelephone = hmTelephone.keySet();
1066
						Iterator<String> itTelephone = colTelephone.iterator();
1071
						Iterator<String> itTelephone = colTelephone.iterator();
1067
					
1072
					
1068
						while (itTelephone.hasNext())	{
1073
						while (itTelephone.hasNext())	{
1069
							String strTelephone = itTelephone.next();
1074
							String strTelephone = itTelephone.next();
1070
							String strTypeTelephone = hmTelephone.get(strTelephone);
1075
							String strTypeTelephone = hmTelephone.get(strTelephone);
1071
							String idTel = hmTel.get(strTypeTelephone);
1076
							String idTel = hmTel.get(strTypeTelephone);
1072
							if (idTel == null)	{
1077
							if (idTel == null)	{
1073
								idTel = strTypeTelephone;
1078
								idTel = strTypeTelephone;
1074
							}
1079
							}
1075
							
1080
							
1076
							ajouterTelephone(strTelephone, idTel, strTypeTelephone);
1081
							ajouterTelephone(strTelephone, idTel, strTypeTelephone);
1077
						}
1082
						}
1078
					}
1083
					}
1079
					
1084
					
1080
					//Courriel
1085
					//Courriel
1081
					LinkedList<String> lCourriels = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_courriel");
1086
					LinkedList<String> lCourriels = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_courriel");
1082
					if (lCourriels != null) {
1087
					if (lCourriels != null) {
1083
						Iterator<String> itCourriels = lCourriels.iterator(); 
1088
						Iterator<String> itCourriels = lCourriels.iterator(); 
1084
					
1089
					
1085
						while (itCourriels.hasNext())	{
1090
						while (itCourriels.hasNext())	{
1086
							String strEmail = itCourriels.next();
1091
							String strEmail = itCourriels.next();
1087
							ajouterCourriel(strEmail);
1092
							ajouterCourriel(strEmail);
1088
						}
1093
						}
1089
					}
1094
					}
1090
					
1095
					
1091
					// Sites
1096
					// Sites
1092
					LinkedList<String> lUrl = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_url");
1097
					LinkedList<String> lUrl = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_url");
1093
					if (lUrl!=null) {
1098
					if (lUrl!=null) {
1094
						Iterator<String> itUrl = lUrl.iterator(); 
1099
						Iterator<String> itUrl = lUrl.iterator(); 
1095
						while (itUrl.hasNext())	{
1100
						while (itUrl.hasNext())	{
1096
							String strUrl = itUrl.next();
1101
							String strUrl = itUrl.next();
1097
							ajouterUrl(strUrl);
1102
							ajouterUrl(strUrl);
1098
						}
1103
						}
1099
					}
1104
					}
1100
					
1105
					
1101
					// Sexe
1106
					// Sexe
1102
					String strSexe = personne.get("ce_sexe");
1107
					String strSexe = personne.get("ce_sexe");
1103
					ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe");
1108
					ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe");
1104
					
1109
					
1105
					
1110
					
1106
					//FIXME : le lien avec la bdd ne peut pas se faire
1111
					//FIXME : le lien avec la bdd ne peut pas se faire
1107
					if (cbSexe.getStore().findModel("abreviation", strSexe) != null)	{
1112
					if (cbSexe.getStore().findModel("abreviation", strSexe) != null)	{
1108
						cbSexe.setValue(cbSexe.getStore().findModel("abreviation", strSexe));
1113
						cbSexe.setValue(cbSexe.getStore().findModel("abreviation", strSexe));
1109
					}	else	{
1114
					}	else	{
1110
						cbSexe.setRawValue(strSexe);
1115
						cbSexe.setRawValue(strSexe);
1111
					}
1116
					}
1112
					
1117
					
1113
					((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
1118
					((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
1114
					
1119
					
1115
					// Logos
1120
					// Logos
1116
					TextArea taLogo = (TextArea) hmIdentite.get("taLogo");
1121
					TextArea taLogo = (TextArea) hmIdentite.get("taLogo");
1117
					LinkedList<String> lLogo = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_logo");
1122
					LinkedList<String> lLogo = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_logo");
1118
					if (lLogo!=null)	{
1123
					if (lLogo!=null)	{
1119
						Iterator<String> itLogo = lLogo.iterator(); 
1124
						Iterator<String> itLogo = lLogo.iterator(); 
1120
						String strValeurLogo = "";
1125
						String strValeurLogo = "";
1121
						while (itLogo.hasNext())	{
1126
						while (itLogo.hasNext())	{
1122
							strValeurLogo += itLogo.next();
1127
							strValeurLogo += itLogo.next();
1123
							if (!strValeurLogo.trim().equals(""))	{
1128
							if (!strValeurLogo.trim().equals(""))	{
1124
								ajouterUrlLogo(strValeurLogo);
1129
								ajouterUrlLogo(strValeurLogo);
1125
							}
1130
							}
1126
						}
1131
						}
1127
					}
1132
					}
1128
					
1133
					
1129
					/*--------------------------------------------------
1134
					/*--------------------------------------------------
1130
					                      Adresse
1135
					                      Adresse
1131
					 ---------------------------------------------------*/
1136
					 ---------------------------------------------------*/
1132
					
1137
					
1133
					// Adresse
1138
					// Adresse
1134
					((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01"));
1139
					((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01"));
1135
	
1140
	
1136
					// Complément
1141
					// Complément
1137
					((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02"));
1142
					((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02"));
1138
					
1143
					
1139
					//Boite postale
1144
					//Boite postale
1140
					((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp"));
1145
					((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp"));
1141
					
1146
					
1142
					//Pays
1147
					//Pays
1143
					String strPays = personne.get("pays");
1148
					String strPays = personne.get("pays");
1144
					ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays");
1149
					ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays");
1145
					
1150
					
1146
					
1151
					
1147
					if (cbPays.getStore().findModel("nom", strPays) != null)	{
1152
					if (cbPays.getStore().findModel("nom", strPays) != null)	{
1148
						cbPays.setValue(cbPays.getStore().findModel("nom", strPays));
1153
						cbPays.setValue(cbPays.getStore().findModel("nom", strPays));
1149
					}	else	{
1154
					}	else	{
1150
						cbPays.setRawValue(strPays);
1155
						cbPays.setRawValue(strPays);
1151
					}
1156
					}
1152
					
1157
					
1153
					
1158
					
1154
					//Région
1159
					//Région
1155
					String strRegion = personne.get("region");
1160
					String strRegion = personne.get("region");
1156
					if ((strRegion!=null)&&(!strRegion.equals("")))	{
1161
					if ((strRegion!=null)&&(!strRegion.equals("")))	{
1157
						ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion");
1162
						ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion");
1158
						cbRegion.setVisible(true);
1163
						cbRegion.setVisible(true);
1159
						
1164
						
1160
						if (cbRegion.getStore().findModel("nom", strRegion) != null)	{
1165
						if (cbRegion.getStore().findModel("nom", strRegion) != null)	{
1161
							cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion));
1166
							cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion));
1162
						}	else	{
1167
						}	else	{
1163
							cbRegion.setRawValue(strRegion);
1168
							cbRegion.setRawValue(strRegion);
1164
						}
1169
						}
1165
					}
1170
					}
1166
					
1171
					
1167
					//Cp
1172
					//Cp
1168
					((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
1173
					((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
1169
					
1174
					
1170
					//Ville
1175
					//Ville
1171
					((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
1176
					((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
1172
					
1177
					
1173
					
1178
					
1174
					((Button) hmIdentite.get("btnEnregistrerRevenir")).setEnabled(true);
1179
					((Button) hmIdentite.get("btnEnregistrerRevenir")).setEnabled(true);
1175
					((Button) hmIdentite.get("btnEnregistrer")).setEnabled(true);
1180
					((Button) hmIdentite.get("btnEnregistrer")).setEnabled(true);
1176
					
1181
					
1177
					nouvellesDonnees = null;
1182
					nouvellesDonnees = null;
1178
				} else {
1183
				} else {
1179
					Info.display("messages", info.getMessages().toString());
1184
					Info.display("messages", info.getMessages().toString());
1180
				}
1185
				}
1181
		} 
1186
		} 
1182
		
1187
		
1183
		if (nouvellesDonnees == null)
1188
		if (nouvellesDonnees == null)
1184
		{
1189
		{
1185
			ComboBox cb= (ComboBox) hmIdentite.get("cbPrefixe");
1190
			ComboBox cb= (ComboBox) hmIdentite.get("cbPrefixe");
1186
			
1191
			
1187
			//Met à jour le nom Complet du formulaire
1192
			//Met à jour le nom Complet du formulaire
1188
			String valeurRetour = "";
1193
			String valeurRetour = "";
1189
			
1194
			
1190
			// Prefixe
1195
			// Prefixe
1191
			String prefixe = "";
1196
			String prefixe = "";
1192
			Valeur valPrefixe = (Valeur) ((ComboBox) hmIdentite.get("cbPrefixe")).getValue();
1197
			Valeur valPrefixe = (Valeur) ((ComboBox) hmIdentite.get("cbPrefixe")).getValue();
1193
			
1198
			
1194
			if (valPrefixe != null)	{
1199
			if (valPrefixe != null)	{
1195
				prefixe = valPrefixe.getNom();
1200
				prefixe = valPrefixe.getNom();
1196
			} else 	{
1201
			} else 	{
1197
				prefixe =  (String) ((ComboBox) hmIdentite.get("cbPrefixe")).getRawValue();
1202
				prefixe =  (String) ((ComboBox) hmIdentite.get("cbPrefixe")).getRawValue();
1198
			}		
1203
			}		
1199
			
1204
			
1200
			
1205
			
1201
			// Prénom
1206
			// Prénom
1202
			String prenom = (String) ((TextField) hmIdentite.get("tfPrenom")).getValue();
1207
			String prenom = (String) ((TextField) hmIdentite.get("tfPrenom")).getValue();
1203
			
1208
			
1204
			// Nom
1209
			// Nom
1205
			String nom = (String) ((TextField) hmIdentite.get("tfNom")).getValue();
1210
			String nom = (String) ((TextField) hmIdentite.get("tfNom")).getValue();
1206
			
1211
			
1207
			// Suffixe
1212
			// Suffixe
1208
			String suffixe = "";
1213
			String suffixe = "";
1209
			Valeur valSuffixe = (Valeur) ((ComboBox) hmIdentite.get("cbSuffixe")).getValue();
1214
			Valeur valSuffixe = (Valeur) ((ComboBox) hmIdentite.get("cbSuffixe")).getValue();
1210
			
1215
			
1211
			if (valSuffixe != null)	{
1216
			if (valSuffixe != null)	{
1212
				suffixe = valSuffixe.getNom();
1217
				suffixe = valSuffixe.getNom();
1213
			} else 	{
1218
			} else 	{
1214
				suffixe =  (String) ((ComboBox) hmIdentite.get("cbSuffixe")).getRawValue();
1219
				suffixe =  (String) ((ComboBox) hmIdentite.get("cbSuffixe")).getRawValue();
1215
			}
1220
			}
1216
			
1221
			
1217
			// Mettre à jour la valeur
1222
			// Mettre à jour la valeur
1218
			valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
1223
			valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
1219
			valeurRetour = valeurRetour.replaceAll("null", "");
1224
			valeurRetour = valeurRetour.replaceAll("null", "");
1220
			
1225
			
1221
			((LabelField) hmIdentite.get("nomComplet")).setValue(valeurRetour);
1226
			((LabelField) hmIdentite.get("nomComplet")).setValue(valeurRetour);
1222
			
1227
			
1223
			if (!valeurRetour.trim().equals(""))	{
1228
			if (!valeurRetour.trim().equals(""))	{
1224
				((LabelField) hmIdentite.get("nomComplet")).show();
1229
				((LabelField) hmIdentite.get("nomComplet")).show();
1225
			} else {
1230
			} else {
1226
				((LabelField) hmIdentite.get("nomComplet")).hide();
1231
				((LabelField) hmIdentite.get("nomComplet")).hide();
1227
			}
1232
			}
1228
		}
1233
		}
1229
		
1234
		
1230
		mediateur.masquerPopinChargement();
1235
		mediateur.masquerPopinChargement();
1231
		
1236
		
1232
		if (this.mode.equals(MODE_AJOUTER))	{
1237
		if (this.mode.equals(MODE_AJOUTER))	{
1233
			((Button) hmIdentite.get("btnEnregistrerRevenir")).setEnabled(true);
1238
			((Button) hmIdentite.get("btnEnregistrerRevenir")).setEnabled(true);
1234
			((Button) hmIdentite.get("btnEnregistrer")).setEnabled(true);
1239
			((Button) hmIdentite.get("btnEnregistrer")).setEnabled(true);
1235
		}
1240
		}
1236
	}
1241
	}
1237
 
1242
 
1238
	private HashMap<String, Valeur> hmCbSelectionnee = new HashMap(); 
1243
	private HashMap<String, Valeur> hmCbSelectionnee = new HashMap(); 
1239
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
1244
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
1240
	
1245
	
1241
		HashMap hm = null;
1246
		HashMap hm = null;
1242
		if (hashMapId.equals("hmIdentite"))	{
1247
		if (hashMapId.equals("hmIdentite"))	{
1243
			hm = hmIdentite;
1248
			hm = hmIdentite;
1244
		} else if (hashMapId.equals("hmAdresse")){
1249
		} else if (hashMapId.equals("hmAdresse")){
1245
			hm = hmAdresse;
1250
			hm = hmAdresse;
1246
		} else {
1251
		} else {
1247
			hm = hmInfosNat;
1252
			hm = hmInfosNat;
1248
		}
1253
		}
1249
		
1254
		
1250
		ListStore<Valeur> store = ((ComboBox) hm.get(idComboBox)).getStore();
1255
		ListStore<Valeur> store = ((ComboBox) hm.get(idComboBox)).getStore();
1251
		
1256
		
1252
		store.removeAll();
1257
		store.removeAll();
1253
		store.add(liste);
1258
		store.add(liste);
1254
		((ComboBox) hm.get(idComboBox)).setStore(store);
1259
		((ComboBox) hm.get(idComboBox)).setStore(store);
1255
		
1260
		
1256
	}
1261
	}
1257
	
1262
	
1258
	
1263
	
1259
	public void ajouterTelephone(String strTelephone, String strValeurTypeTel, String idTel) 	{
1264
	public void ajouterTelephone(String strTelephone, String strValeurTypeTel, String idTel) 	{
1260
		
1265
		
1261
			
1266
			
1262
				//Ajout d'un champ à la liste
1267
				//Ajout d'un champ à la liste
1263
				String strIdTelephone =  idTel + "##" + strTelephone + ";;";	
1268
				String strIdTelephone =  idTel + "##" + strTelephone + ";;";	
1264
				
1269
				
1265
				FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
1270
				FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
1266
				
1271
				
1267
				LayoutContainer lcTelephone = new LayoutContainer();
1272
				LayoutContainer lcTelephone = new LayoutContainer();
1268
				lcTelephone.setLayout(new ColumnLayout());
1273
				lcTelephone.setLayout(new ColumnLayout());
1269
				
1274
				
1270
				Text tTypeTelephone = new Text();
1275
				Text tTypeTelephone = new Text();
1271
				tTypeTelephone.setText(strValeurTypeTel+":");
1276
				tTypeTelephone.setText(strValeurTypeTel+":");
1272
				
1277
				
1273
				hmIdentite.put("type-" + strIdTelephone, tTypeTelephone);
1278
				hmIdentite.put("type-" + strIdTelephone, tTypeTelephone);
1274
				lcTelephone.add(tTypeTelephone, new ColumnData(0.40));
1279
				lcTelephone.add(tTypeTelephone, new ColumnData(0.40));
1275
				
1280
				
1276
				Text tTelephone = new Text();
1281
				Text tTelephone = new Text();
1277
				tTelephone.setText(strTelephone);
1282
				tTelephone.setText(strTelephone);
1278
				hmIdentite.put("tel-" + strIdTelephone, tTelephone);
1283
				hmIdentite.put("tel-" + strIdTelephone, tTelephone);
1279
				lcTelephone.add(tTelephone, new ColumnData(0.40));
1284
				lcTelephone.add(tTelephone, new ColumnData(0.40));
1280
				
1285
				
-
 
1286
				Button bSupprimer = new Button();
1281
				IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1287
				bSupprimer.setIcon(Images.ICONES.supprimer());
1282
				bSupprimer.setId(strIdTelephone);
1288
				bSupprimer.setId(strIdTelephone);
1283
				
1289
				
1284
				bSupprimer.addSelectionListener(new SelectionListener<IconButtonEvent>() {
1290
				bSupprimer.addSelectionListener(new SelectionListener<ButtonEvent>() {
1285
						public void componentSelected(IconButtonEvent ce) {
1291
						public void componentSelected(ButtonEvent ce) {
1286
							
1292
							
1287
							String strIdTelephone = ce.getComponent().getId();
1293
							String strIdTelephone = ce.getComponent().getId();
1288
							LayoutContainer lcContactTel = (LayoutContainer) hmIdentite.get("lc-"+strIdTelephone);
1294
							LayoutContainer lcContactTel = (LayoutContainer) hmIdentite.get("lc-"+strIdTelephone);
1289
							
1295
							
1290
							lcContactTel.remove(hmIdentite.get("type-" + strIdTelephone));
1296
							lcContactTel.remove(hmIdentite.get("type-" + strIdTelephone));
1291
							hmIdentite.remove("type-" + strIdTelephone);
1297
							hmIdentite.remove("type-" + strIdTelephone);
1292
							
1298
							
1293
							lcContactTel.remove(hmIdentite.get("tel-" + strIdTelephone));
1299
							lcContactTel.remove(hmIdentite.get("tel-" + strIdTelephone));
1294
							hmIdentite.remove("tel-" + strIdTelephone);
1300
							hmIdentite.remove("tel-" + strIdTelephone);
1295
							
1301
							
1296
							lcContactTel.remove(ce.getComponent());
1302
							lcContactTel.remove(ce.getComponent());
1297
							
1303
							
1298
							FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
1304
							FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
1299
							fsContactTel.remove(lcContactTel);
1305
							fsContactTel.remove(lcContactTel);
1300
							
1306
							
1301
							HiddenField<String> hfTelephone = (HiddenField) hmIdentite.get("hfTelephone");
1307
							HiddenField<String> hfTelephone = (HiddenField) hmIdentite.get("hfTelephone");
1302
							String strValeurTelephone = hfTelephone.getValue();
1308
							String strValeurTelephone = hfTelephone.getValue();
1303
							strValeurTelephone = strValeurTelephone.replace(strIdTelephone, "");
1309
							strValeurTelephone = strValeurTelephone.replace(strIdTelephone, "");
1304
							hfTelephone.setValue(strValeurTelephone);
1310
							hfTelephone.setValue(strValeurTelephone);
1305
							
1311
							
1306
							layout();
1312
							layout();
1307
							
1313
							
1308
						}
1314
						}
1309
				});
1315
				});
1310
				
1316
				
1311
				lcTelephone.add(bSupprimer, new ColumnData(0.15));
1317
				lcTelephone.add(bSupprimer, new ColumnData(0.15));
1312
				
1318
				
1313
				hmIdentite.put("lc-"+strIdTelephone, lcTelephone);
1319
				hmIdentite.put("lc-"+strIdTelephone, lcTelephone);
1314
				fsContactTel.add(lcTelephone);
1320
				fsContactTel.add(lcTelephone);
1315
				
1321
				
1316
				HiddenField<String> hfTelephone = (HiddenField) hmIdentite.get("hfTelephone");
1322
				HiddenField<String> hfTelephone = (HiddenField) hmIdentite.get("hfTelephone");
1317
				String strValeurTelephone = hfTelephone.getValue();
1323
				String strValeurTelephone = hfTelephone.getValue();
1318
				if (strValeurTelephone==null)	{
1324
				if (strValeurTelephone==null)	{
1319
					strValeurTelephone = "";
1325
					strValeurTelephone = "";
1320
				}
1326
				}
1321
				strValeurTelephone += strIdTelephone;
1327
				strValeurTelephone += strIdTelephone;
1322
				hfTelephone.setValue(strValeurTelephone);
1328
				hfTelephone.setValue(strValeurTelephone);
1323
				
1329
				
1324
				layout();
1330
				layout();
1325
			
1331
			
1326
			
1332
			
1327
		
1333
		
1328
		
1334
		
1329
	}
1335
	}
1330
	
1336
	
1331
	public void ajouterCourriel(String strEmail)	{
1337
	public void ajouterCourriel(String strEmail)	{
1332
			
1338
			
1333
			TextField<String> tfCourriel = (TextField<String>) hmIdentite.get("tfCourriel");
1339
			TextField<String> tfCourriel = (TextField<String>) hmIdentite.get("tfCourriel");
1334
			tfCourriel.setValue("");
1340
			tfCourriel.setValue("");
1335
			
1341
			
1336
			//Ajouter adresse email
1342
			//Ajouter adresse email
1337
			LayoutContainer lcCourrielContainer = (LayoutContainer) hmIdentite.get("lcCourrielContainer");
1343
			LayoutContainer lcCourrielContainer = (LayoutContainer) hmIdentite.get("lcCourrielContainer");
1338
			
1344
			
1339
			LayoutContainer lcCourriel = new LayoutContainer();
1345
			LayoutContainer lcCourriel = new LayoutContainer();
1340
			lcCourriel.setLayout(new ColumnLayout());
1346
			lcCourriel.setLayout(new ColumnLayout());
1341
			
1347
			
1342
			LabelField lfCourriel = new LabelField();
1348
			LabelField lfCourriel = new LabelField();
1343
			lfCourriel.setText(strEmail);
1349
			lfCourriel.setText(strEmail);
1344
			
1350
			
1345
			lcCourriel.add(lfCourriel, new ColumnData(0.8));
1351
			lcCourriel.add(lfCourriel, new ColumnData(0.8));
1346
			hmIdentite.put("lc-" + strEmail, lcCourriel);
1352
			hmIdentite.put("lc-" + strEmail, lcCourriel);
1347
			
1353
			
1348
			//Bouton supprimer
1354
			//Bouton supprimer
1349
			IconButton btnSupprimerCourriel = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1355
			Button btnSupprimerCourriel = new Button();
-
 
1356
			btnSupprimerCourriel.setIcon(Images.ICONES.supprimer());
1350
			btnSupprimerCourriel.setId(strEmail);
1357
			btnSupprimerCourriel.setId(strEmail);
1351
			btnSupprimerCourriel.addSelectionListener(new SelectionListener<IconButtonEvent>() {
1358
			btnSupprimerCourriel.addSelectionListener(new SelectionListener<ButtonEvent>() {
1352
				
1359
				
1353
				public void componentSelected(IconButtonEvent ce) {
1360
				public void componentSelected(ButtonEvent ce) {
1354
					//Suppression de l'adresse email
1361
					//Suppression de l'adresse email
1355
					String strEmail = ce.getComponent().getId();
1362
					String strEmail = ce.getComponent().getId();
1356
					LayoutContainer lcCourrielContainer = (LayoutContainer) hmIdentite.get("lcCourrielContainer");
1363
					LayoutContainer lcCourrielContainer = (LayoutContainer) hmIdentite.get("lcCourrielContainer");
1357
					LayoutContainer lcCourriel = (LayoutContainer) hmIdentite.get("lc-" + strEmail);
1364
					LayoutContainer lcCourriel = (LayoutContainer) hmIdentite.get("lc-" + strEmail);
1358
					lcCourrielContainer.remove(lcCourriel);
1365
					lcCourrielContainer.remove(lcCourriel);
1359
					
1366
					
1360
					hmIdentite.remove("lc-" + strEmail);
1367
					hmIdentite.remove("lc-" + strEmail);
1361
					hmIdentite.remove("email-" + strEmail);
1368
					hmIdentite.remove("email-" + strEmail);
1362
					
1369
					
1363
						HiddenField<String> hfHiddenCourriel = (HiddenField) hmIdentite.get("hfHiddenCourriel");
1370
						HiddenField<String> hfHiddenCourriel = (HiddenField) hmIdentite.get("hfHiddenCourriel");
1364
					String strValeurCourriel = hfHiddenCourriel.getValue();
1371
					String strValeurCourriel = hfHiddenCourriel.getValue();
1365
					strValeurCourriel = strValeurCourriel.replace(strEmail + ";;", "");
1372
					strValeurCourriel = strValeurCourriel.replace(strEmail + ";;", "");
1366
					hfHiddenCourriel.setValue(strValeurCourriel);
1373
					hfHiddenCourriel.setValue(strValeurCourriel);
1367
					
1374
					
1368
				}
1375
				}
1369
				
1376
				
1370
			});
1377
			});
1371
			
1378
			
1372
			lcCourriel.add(btnSupprimerCourriel);
1379
			lcCourriel.add(btnSupprimerCourriel);
1373
			
1380
			
1374
			
1381
			
1375
			
1382
			
1376
			lcCourrielContainer.add(lcCourriel);
1383
			lcCourrielContainer.add(lcCourriel);
1377
			hmIdentite.put("email-" + strEmail, lfCourriel);	
1384
			hmIdentite.put("email-" + strEmail, lfCourriel);	
1378
			
1385
			
1379
			HiddenField<String> hfHiddenCourriel = (HiddenField) hmIdentite.get("hfHiddenCourriel");
1386
			HiddenField<String> hfHiddenCourriel = (HiddenField) hmIdentite.get("hfHiddenCourriel");
1380
			String strHiddenCourrielValue = hfHiddenCourriel.getValue();
1387
			String strHiddenCourrielValue = hfHiddenCourriel.getValue();
1381
			if (strHiddenCourrielValue == null) { 
1388
			if (strHiddenCourrielValue == null) { 
1382
				strHiddenCourrielValue = "";
1389
				strHiddenCourrielValue = "";
1383
			}
1390
			}
1384
			hfHiddenCourriel.setRawValue(strHiddenCourrielValue + strEmail + ";;");
1391
			hfHiddenCourriel.setRawValue(strHiddenCourrielValue + strEmail + ";;");
1385
			
1392
			
1386
			
1393
			
1387
			layout();
1394
			layout();
1388
			
1395
			
1389
	}
1396
	}
1390
	
1397
	
1391
	public void ajouterUrl(String strUrl)	{
1398
	public void ajouterUrl(String strUrl)	{
1392
		
1399
		
1393
		LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcUrlContainer");
1400
		LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcUrlContainer");
1394
		
1401
		
1395
		LayoutContainer lcUrl = new LayoutContainer();
1402
		LayoutContainer lcUrl = new LayoutContainer();
1396
		lcUrl.setLayout(new ColumnLayout());
1403
		lcUrl.setLayout(new ColumnLayout());
1397
		hmIdentite.put("lc-" + strUrl, lcUrl);
1404
		hmIdentite.put("lc-" + strUrl, lcUrl);
1398
		
1405
		
1399
		
1406
		
1400
		Text tUrl = new Text(strUrl);
1407
		Text tUrl = new Text(strUrl);
1401
		hmIdentite.put("url-"+strUrl, tUrl);
1408
		hmIdentite.put("url-"+strUrl, tUrl);
1402
		
1409
		
1403
		lcUrl.add(tUrl, new ColumnData(0.8));
1410
		lcUrl.add(tUrl, new ColumnData(0.8));
1404
		
1411
		
-
 
1412
		Button ibSupprimerUrl = new Button();
1405
		IconButton ibSupprimerUrl = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1413
		ibSupprimerUrl.setIcon(Images.ICONES.supprimer());
1406
		ibSupprimerUrl.setId(strUrl);
1414
		ibSupprimerUrl.setId(strUrl);
1407
		ibSupprimerUrl.addSelectionListener(new SelectionListener<IconButtonEvent>() {
1415
		ibSupprimerUrl.addSelectionListener(new SelectionListener<ButtonEvent>() {
1408
 
1416
 
1409
			public void componentSelected(IconButtonEvent ce) {
1417
			public void componentSelected(ButtonEvent ce) {
1410
				
1418
				
1411
				//Suppression url
1419
				//Suppression url
1412
				String strUrl = ce.getComponent().getId();
1420
				String strUrl = ce.getComponent().getId();
1413
				LayoutContainer lcUrl = (LayoutContainer) hmIdentite.get("lc-" + strUrl);
1421
				LayoutContainer lcUrl = (LayoutContainer) hmIdentite.get("lc-" + strUrl);
1414
				LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcUrlContainer");
1422
				LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcUrlContainer");
1415
				
1423
				
1416
				lcUrlContainer.remove(lcUrl);
1424
				lcUrlContainer.remove(lcUrl);
1417
				
1425
				
1418
				
1426
				
1419
				HiddenField<String> hfUrl = (HiddenField<String>) hmIdentite.get("hfUrl");
1427
				HiddenField<String> hfUrl = (HiddenField<String>) hmIdentite.get("hfUrl");
1420
				String strValeurUrl = hfUrl.getValue();
1428
				String strValeurUrl = hfUrl.getValue();
1421
				strValeurUrl = strValeurUrl.replace(strUrl, "");
1429
				strValeurUrl = strValeurUrl.replace(strUrl, "");
1422
				hfUrl.setValue(strValeurUrl);
1430
				hfUrl.setValue(strValeurUrl);
1423
				
1431
				
1424
			}
1432
			}
1425
		});
1433
		});
1426
		
1434
		
1427
		lcUrl.add(ibSupprimerUrl, new ColumnData(0.15));
1435
		lcUrl.add(ibSupprimerUrl, new ColumnData(0.15));
1428
		lcUrlContainer.add(lcUrl);
1436
		lcUrlContainer.add(lcUrl);
1429
		
1437
		
1430
		HiddenField<String> hfUrl = (HiddenField<String>) hmIdentite.get("hfUrl");
1438
		HiddenField<String> hfUrl = (HiddenField<String>) hmIdentite.get("hfUrl");
1431
		String strValeurUrl = hfUrl.getValue();
1439
		String strValeurUrl = hfUrl.getValue();
1432
		if (strValeurUrl == null)	{
1440
		if (strValeurUrl == null)	{
1433
			strValeurUrl = "";
1441
			strValeurUrl = "";
1434
		}
1442
		}
1435
		
1443
		
1436
		strValeurUrl += strUrl + ";;";
1444
		strValeurUrl += strUrl + ";;";
1437
		hfUrl.setValue(strValeurUrl);
1445
		hfUrl.setValue(strValeurUrl);
1438
		
1446
		
1439
		layout();
1447
		layout();
1440
		
1448
		
1441
		
1449
		
1442
		
1450
		
1443
	}
1451
	}
1444
	
1452
	
1445
	public void ajouterUrlLogo(String strUrl)	{
1453
	public void ajouterUrlLogo(String strUrl)	{
1446
		
1454
		
1447
		LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcAutreInformations2");
1455
		LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcAutreInformations2");
1448
		
1456
		
1449
		LayoutContainer lcUrl = new LayoutContainer();
1457
		LayoutContainer lcUrl = new LayoutContainer();
1450
		lcUrl.setLayout(new ColumnLayout());
1458
		lcUrl.setLayout(new ColumnLayout());
1451
		hmIdentite.put("lc-" + strUrl, lcUrl);
1459
		hmIdentite.put("lc-" + strUrl, lcUrl);
1452
		
1460
		
1453
		
1461
		
1454
		Text tUrl = new Text(strUrl);
1462
		Text tUrl = new Text(strUrl);
1455
		hmIdentite.put("url-"+strUrl, tUrl);
1463
		hmIdentite.put("url-"+strUrl, tUrl);
1456
		
1464
		
1457
		lcUrl.add(tUrl, new ColumnData(0.8));
1465
		lcUrl.add(tUrl, new ColumnData(0.8));
1458
		
1466
		
-
 
1467
		Button ibSupprimerUrl = new Button();
1459
		IconButton ibSupprimerUrl = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1468
		ibSupprimerUrl.setIcon(Images.ICONES.supprimer());
1460
		ibSupprimerUrl.setId(strUrl);
1469
		ibSupprimerUrl.setId(strUrl);
1461
		ibSupprimerUrl.addSelectionListener(new SelectionListener<IconButtonEvent>() {
1470
		ibSupprimerUrl.addSelectionListener(new SelectionListener<ButtonEvent>() {
1462
 
1471
 
1463
			public void componentSelected(IconButtonEvent ce) {
1472
			public void componentSelected(ButtonEvent ce) {
1464
				
1473
				
1465
				//Suppression url
1474
				//Suppression url
1466
				String strUrl = ce.getComponent().getId();
1475
				String strUrl = ce.getComponent().getId();
1467
				LayoutContainer lcUrl = (LayoutContainer) hmIdentite.get("lc-" + strUrl);
1476
				LayoutContainer lcUrl = (LayoutContainer) hmIdentite.get("lc-" + strUrl);
1468
				LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcAutreInformations2");
1477
				LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcAutreInformations2");
1469
				
1478
				
1470
				lcUrlContainer.remove(lcUrl);
1479
				lcUrlContainer.remove(lcUrl);
1471
				
1480
				
1472
				HiddenField<String> hfUrlLogo = (HiddenField<String>) hmIdentite.get("hfUrlLogo");
1481
				HiddenField<String> hfUrlLogo = (HiddenField<String>) hmIdentite.get("hfUrlLogo");
1473
				String strValeurUrl = hfUrlLogo.getValue();
1482
				String strValeurUrl = hfUrlLogo.getValue();
1474
				strValeurUrl = strUrl.replace(strUrl, "");
1483
				strValeurUrl = strUrl.replace(strUrl, "");
1475
				
1484
				
1476
				hfUrlLogo.setValue(strValeurUrl);
1485
				hfUrlLogo.setValue(strValeurUrl);
1477
			}
1486
			}
1478
		});
1487
		});
1479
		
1488
		
1480
		lcUrl.add(ibSupprimerUrl, new ColumnData(0.15));
1489
		lcUrl.add(ibSupprimerUrl, new ColumnData(0.15));
1481
		lcUrlContainer.add(lcUrl);
1490
		lcUrlContainer.add(lcUrl);
1482
		
1491
		
1483
		HiddenField<String> hfUrlLogo = (HiddenField<String>) hmIdentite.get("hfUrlLogo");
1492
		HiddenField<String> hfUrlLogo = (HiddenField<String>) hmIdentite.get("hfUrlLogo");
1484
		String strValeurUrl = hfUrlLogo.getValue();
1493
		String strValeurUrl = hfUrlLogo.getValue();
1485
		if (strValeurUrl == null)	{
1494
		if (strValeurUrl == null)	{
1486
			strValeurUrl = "";
1495
			strValeurUrl = "";
1487
		}
1496
		}
1488
		
1497
		
1489
		strValeurUrl += strUrl + ";;";
1498
		strValeurUrl += strUrl + ";;";
1490
		
1499
		
1491
		hfUrlLogo.setValue(strValeurUrl);
1500
		hfUrlLogo.setValue(strValeurUrl);
1492
		
1501
		
1493
		layout();
1502
		layout();
1494
	}
1503
	}
1495
	
1504
	
1496
	public void reinitialiser()	{
1505
	public void reinitialiser()	{
1497
	 
1506
	 
1498
		mediateur.afficherPopinChargement();
1507
		mediateur.afficherPopinChargement();
1499
		
1508
		
1500
		binderPersonne(personneSauvegarde);
1509
		binderPersonne(personneSauvegarde);
1501
		layout();
1510
		layout();
1502
		
1511
		
1503
		mediateur.masquerPopinChargement();
1512
		mediateur.masquerPopinChargement();
1504
	}
1513
	}
1505
	
1514
	
1506
	
1515
	
1507
	
1516
	
1508
	public void binderPersonne(Personne personne)	{
1517
	public void binderPersonne(Personne personne)	{
1509
		
1518
		
1510
		binding = new FormBinding(this);
1519
		binding = new FormBinding(this);
1511
			
1520
			
1512
		personneSelectionnee = personne;
1521
		personneSelectionnee = personne;
1513
		binding.autoBind();
1522
		binding.autoBind();
1514
		binding.bind(personneSelectionnee);
1523
		binding.bind(personneSelectionnee);
1515
		
1524
		
1516
		layout();
1525
		layout();
1517
	}
1526
	}
1518
 
1527
 
1519
	/**
1528
	/**
1520
	 * Enregistre les information de la personne en cours 
1529
	 * Enregistre les information de la personne en cours 
1521
	 * 
1530
	 * 
1522
	 */
1531
	 */
1523
	public void enregistrer()	{
1532
	public void enregistrer()	{
1524
		
1533
		
1525
		LinkedList lstMessageErreur = new LinkedList<String>();
1534
		LinkedList lstMessageErreur = new LinkedList<String>();
1526
		
1535
		
1527
		ComboBox<Projet> cbProjets = (ComboBox<Projet>) hmIdentite.get("cbProjets");
1536
		ComboBox<Projet> cbProjets = (ComboBox<Projet>) hmIdentite.get("cbProjets");
1528
		Projet projet = cbProjets.getValue();
1537
		Projet projet = cbProjets.getValue();
1529
		if (projet == null)	{
1538
		if (projet == null)	{
1530
			lstMessageErreur.add("Le projet n'a pas été renseigné");
1539
			lstMessageErreur.add("Le projet n'a pas été renseigné");
1531
		}
1540
		}
1532
		
1541
		
1533
		String strTfNom = ((TextField<String>) hmIdentite.get("tfNom")).getValue();
1542
		String strTfNom = ((TextField<String>) hmIdentite.get("tfNom")).getValue();
1534
		if ((strTfNom == null)||(strTfNom.trim().equals("")))	{
1543
		if ((strTfNom == null)||(strTfNom.trim().equals("")))	{
1535
			lstMessageErreur.add("Le nom n'a pas été saisi");
1544
			lstMessageErreur.add("Le nom n'a pas été saisi");
1536
		}
1545
		}
1537
		 
1546
		 
1538
		
1547
		
1539
		//Préparer les données
1548
		//Préparer les données
1540
		ComboBox combo = (ComboBox) hmIdentite.get("cbSexe");
1549
		ComboBox combo = (ComboBox) hmIdentite.get("cbSexe");
1541
		Valeur valeur;
1550
		Valeur valeur;
1542
		String strValeur = "";
1551
		String strValeur = "";
1543
		
1552
		
1544
		if (combo.getValue()!=null)	{
1553
		if (combo.getValue()!=null)	{
1545
			valeur = (Valeur) combo.getValue();
1554
			valeur = (Valeur) combo.getValue();
1546
			strValeur = valeur.getId();
1555
			strValeur = valeur.getId();
1547
		} 
1556
		} 
1548
		
1557
		
1549
		if (!strValeur.trim().equals(""))	{
1558
		if (!strValeur.trim().equals(""))	{
1550
			personneSelectionnee.set("sexe", strValeur);
1559
			personneSelectionnee.set("sexe", strValeur);
1551
		} 
1560
		} 
1552
		
1561
		
1553
		strValeur = obtenirValeurCombo("cbPrefixe");
1562
		strValeur = obtenirValeurCombo("cbPrefixe");
1554
		personneSelectionnee.set("ce_truk_prefix", strValeur);
1563
		personneSelectionnee.set("ce_truk_prefix", strValeur);
1555
		
1564
		
1556
		strValeur = obtenirValeurCombo("cbSuffixe"); 
1565
		strValeur = obtenirValeurCombo("cbSuffixe"); 
1557
		personneSelectionnee.set("ce_truk_suffix", strValeur);
1566
		personneSelectionnee.set("ce_truk_suffix", strValeur);
1558
		
1567
		
1559
		personneSelectionnee.set("truk_courriel", ((HiddenField<String>) hmIdentite.get("hfHiddenCourriel")).getValue());
1568
		personneSelectionnee.set("truk_courriel", ((HiddenField<String>) hmIdentite.get("hfHiddenCourriel")).getValue());
1560
		
1569
		
1561
		
1570
		
1562
		//Pour le nom complet, on enregistre dans la bdd la valeur du prefixe/suffixe et non l'id
1571
		//Pour le nom complet, on enregistre dans la bdd la valeur du prefixe/suffixe et non l'id
1563
		String strPrefixe = "";
1572
		String strPrefixe = "";
1564
		combo = (ComboBox) hmIdentite.get("cbPrefixe");
1573
		combo = (ComboBox) hmIdentite.get("cbPrefixe");
1565
		valeur = (Valeur) combo.getValue();
1574
		valeur = (Valeur) combo.getValue();
1566
		if (valeur != null)	{
1575
		if (valeur != null)	{
1567
			strPrefixe = valeur.getNom();
1576
			strPrefixe = valeur.getNom();
1568
		} else {
1577
		} else {
1569
			strPrefixe = combo.getRawValue();
1578
			strPrefixe = combo.getRawValue();
1570
		}
1579
		}
1571
		
1580
		
1572
		String strSuffixe = "";
1581
		String strSuffixe = "";
1573
		combo = (ComboBox) hmIdentite.get("cbSuffixe");
1582
		combo = (ComboBox) hmIdentite.get("cbSuffixe");
1574
		valeur = (Valeur) combo.getValue();
1583
		valeur = (Valeur) combo.getValue();
1575
		if (valeur != null)	{
1584
		if (valeur != null)	{
1576
			strSuffixe = valeur.getNom() + " ";
1585
			strSuffixe = valeur.getNom() + " ";
1577
		} else {
1586
		} else {
1578
			strSuffixe = combo.getRawValue() +" ";
1587
			strSuffixe = combo.getRawValue() +" ";
1579
		}
1588
		}
1580
		
1589
		
1581
		personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
1590
		personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
1582
		
1591
		
1583
		
1592
		
1584
		DateField dfDateNaissance = (DateField) hmIdentite.get("dfDateNaissance");
1593
		DateField dfDateNaissance = (DateField) hmIdentite.get("dfDateNaissance");
1585
		Date naissanceDate = dfDateNaissance.getValue();
1594
		Date naissanceDate = dfDateNaissance.getValue();
1586
		personneSelectionnee.setNaissanceDate(naissanceDate);
1595
		personneSelectionnee.setNaissanceDate(naissanceDate);
1587
		
1596
		
1588
		Radio rbEstDecedee = (Radio) hmIdentite.get("rbEstDecedee");
1597
		Radio rbEstDecedee = (Radio) hmIdentite.get("rbEstDecedee");
1589
		if (rbEstDecedee.getValue().equals(true))	{
1598
		if (rbEstDecedee.getValue().equals(true))	{
1590
			
1599
			
1591
			DateField dfDecesDate = (DateField) hmIdentite.get("dfDateDeces");
1600
			DateField dfDecesDate = (DateField) hmIdentite.get("dfDateDeces");
1592
			Date decesDate = dfDecesDate.getValue();
1601
			Date decesDate = dfDecesDate.getValue();
1593
			if (decesDate == null)	{
1602
			if (decesDate == null)	{
1594
				decesDate = new Date();
1603
				decesDate = new Date();
1595
			}
1604
			}
1596
			personneSelectionnee.setDecesDate(decesDate);
1605
			personneSelectionnee.setDecesDate(decesDate);
1597
			personneSelectionnee.set("deces_lieu", ((TextField<String>) hmIdentite.get("tfLieuDeces")).getValue());
1606
			personneSelectionnee.set("deces_lieu", ((TextField<String>) hmIdentite.get("tfLieuDeces")).getValue());
1598
		}
1607
		}
1599
		
1608
		
1600
		personneSelectionnee.setDecesDate(new Date());
1609
		personneSelectionnee.setDecesDate(new Date());
1601
		
1610
		
1602
		strValeur = obtenirValeurCombo("cbPays");
1611
		strValeur = obtenirValeurCombo("cbPays");
1603
		personneSelectionnee.set("pays", strValeur);
1612
		personneSelectionnee.set("pays", strValeur);
1604
		
1613
		
1605
		strValeur = obtenirValeurCombo("cbRegion");
1614
		strValeur = obtenirValeurCombo("cbRegion");
1606
		personneSelectionnee.set("region", strValeur);
1615
		personneSelectionnee.set("region", strValeur);
1607
		
1616
		
1608
		personneSelectionnee.set("truk_telephone", ((HiddenField<String>) hmIdentite.get("hfTelephone")).getValue());
1617
		personneSelectionnee.set("truk_telephone", ((HiddenField<String>) hmIdentite.get("hfTelephone")).getValue());
1609
		
1618
		
1610
		String logoUrls = ((HiddenField<String>) hmIdentite.get("hfUrlLogo")).getValue();
1619
		String logoUrls = ((HiddenField<String>) hmIdentite.get("hfUrlLogo")).getValue();
1611
		if (logoUrls == null)	{
1620
		if (logoUrls == null)	{
1612
			logoUrls = "";
1621
			logoUrls = "";
1613
		}
1622
		}
1614
		personneSelectionnee.set("truk_logo", logoUrls);
1623
		personneSelectionnee.set("truk_logo", logoUrls);
1615
		
1624
		
1616
		personneSelectionnee.set("truk_url", ((HiddenField) hmIdentite.get("hfUrl")).getValue());
1625
		personneSelectionnee.set("truk_url", ((HiddenField) hmIdentite.get("hfUrl")).getValue());
1617
		
1626
		
1618
		if (lstMessageErreur.size() == 0)	{
1627
		if (lstMessageErreur.size() == 0)	{
1619
			mediateur.enregistrerPersonne(this, personneSelectionnee);
1628
			mediateur.enregistrerPersonne(this, personneSelectionnee);
1620
		} else {
1629
		} else {
1621
			String strMessagesErreur = "<span><br />";
1630
			String strMessagesErreur = "<span><br />";
1622
			Iterator<String> itMessagesErreur = lstMessageErreur.iterator();
1631
			Iterator<String> itMessagesErreur = lstMessageErreur.iterator();
1623
			while (itMessagesErreur.hasNext())	{
1632
			while (itMessagesErreur.hasNext())	{
1624
				strMessagesErreur += "<br /> - " + itMessagesErreur.next();
1633
				strMessagesErreur += "<br /> - " + itMessagesErreur.next();
1625
			}
1634
			}
1626
			strMessagesErreur += "</span>";
1635
			strMessagesErreur += "</span>";
1627
			
1636
			
1628
 			MessageBox.alert("Erreurs", "Les erreurs suivantes ont été commises : \n" + strMessagesErreur, null);
1637
 			MessageBox.alert("Erreurs", "Les erreurs suivantes ont été commises : \n" + strMessagesErreur, null);
1629
		}
1638
		}
1630
	}
1639
	}
1631
	
1640
	
1632
	private String obtenirValeurCombo(String strComboName)	{
1641
	private String obtenirValeurCombo(String strComboName)	{
1633
		
1642
		
1634
		String strValeur = "";
1643
		String strValeur = "";
1635
		Valeur valeur;
1644
		Valeur valeur;
1636
		
1645
		
1637
		ComboBox combo = (ComboBox) hmIdentite.get(strComboName);
1646
		ComboBox combo = (ComboBox) hmIdentite.get(strComboName);
1638
		if (combo == null)	{
1647
		if (combo == null)	{
1639
			combo = (ComboBox) hmAdresse.get(strComboName);
1648
			combo = (ComboBox) hmAdresse.get(strComboName);
1640
		}
1649
		}
1641
		if (combo.getValue()!=null)	{
1650
		if (combo.getValue()!=null)	{
1642
			valeur = (Valeur) combo.getValue();
1651
			valeur = (Valeur) combo.getValue();
1643
			strValeur = valeur.getId();
1652
			strValeur = valeur.getId();
1644
		} else {
1653
		} else {
1645
			strValeur = combo.getRawValue();
1654
			strValeur = combo.getRawValue();
1646
		}
1655
		}
1647
		
1656
		
1648
		return strValeur;
1657
		return strValeur;
1649
	}
1658
	}
1650
}
1659
}