Subversion Repositories eFlore/Applications.coel

Rev

Rev 1292 | Rev 1329 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1292 Rev 1322
Line 31... Line 31...
31
import org.tela_botanica.client.modeles.projet.Projet;
31
import org.tela_botanica.client.modeles.projet.Projet;
32
import org.tela_botanica.client.modeles.projet.ProjetListe;
32
import org.tela_botanica.client.modeles.projet.ProjetListe;
33
import org.tela_botanica.client.modeles.publication.Publication;
33
import org.tela_botanica.client.modeles.publication.Publication;
34
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
34
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
35
import org.tela_botanica.client.modeles.publication.PublicationListe;
35
import org.tela_botanica.client.modeles.publication.PublicationListe;
-
 
36
import org.tela_botanica.client.synchronisation.Sequenceur;
36
import org.tela_botanica.client.util.Pattern;
37
import org.tela_botanica.client.util.Pattern;
37
import org.tela_botanica.client.util.UtilString;
38
import org.tela_botanica.client.util.UtilString;
38
import org.tela_botanica.client.vues.Formulaire;
39
import org.tela_botanica.client.vues.Formulaire;
Line 39... Line 40...
39
 
40
 
Line 117... Line 118...
117
	
118
	
118
	private Personne personne = null;
119
	private Personne personne = null;
119
	private String personneId = null;
120
	private String personneId = null;
Line -... Line 121...
-
 
121
	private FormBinding binding = null;
-
 
122
	
-
 
123
	//Gestion du mode synchrone
120
	private FormBinding binding = null;
124
	private Sequenceur sequenceur;
121
	
125
	
122
	//Publi
126
	//Publi
Line 123... Line 127...
123
	private ComboBox<Publication> cbPubli;
127
	private ComboBox<Publication> cbPubli;
Line 133... Line 137...
133
		initialiserPersonneForm(mediateurCourrant, personneId);		
137
		initialiserPersonneForm(mediateurCourrant, personneId);		
134
	}
138
	}
Line 135... Line 139...
135
	
139
	
Line -... Line 140...
-
 
140
	private void initialiserPersonneForm(Mediateur mediateurCourrant, String personneIdCourrant) {
-
 
141
		
136
	private void initialiserPersonneForm(Mediateur mediateurCourrant, String personneIdCourrant) {
142
		//Initialisation du séquenceur
137
		
143
		sequenceur = new Sequenceur();
138
		personne = new Personne();
144
		personne = new Personne();
Line 139... Line 145...
139
		personne.setId(personneIdCourrant);
145
		personne.setId(personneIdCourrant);
140
		personneId = personneIdCourrant;
146
		personneId = personneIdCourrant;
Line 141... Line 147...
141
		
147
		
142
		String modeDeCreation = (UtilString.isEmpty(personneId) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
148
		String modeDeCreation = (UtilString.isEmpty(personneId) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
Line 143... Line 149...
143
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PERSONNE);
149
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PERSONNE);
144
 
150
 
145
		initialiserComposants();
151
		initialiserComposants();
146
		genererTitreFormulaire();
152
		genererTitreFormulaire();
147
		
153
		
Line 148... Line 154...
148
		mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication");
154
		mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", sequenceur);
149
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
155
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
Line 250... Line 256...
250
		cbProjets.addListener(Events.Valid, creerEcouteurChampObligatoire());
256
		cbProjets.addListener(Events.Valid, creerEcouteurChampObligatoire());
251
		fsProjet.add(cbProjets, new FormData(250, 0));
257
		fsProjet.add(cbProjets, new FormData(250, 0));
Line 252... Line 258...
252
		
258
		
Line 253... Line 259...
253
		hmIdentite.put("cbProjets", cbProjets);
259
		hmIdentite.put("cbProjets", cbProjets);
Line 254... Line 260...
254
		
260
		
Line 255... Line 261...
255
		mediateur.selectionnerProjet(this, null);
261
		mediateur.selectionnerProjet(this, null, sequenceur);
256
				
262
				
Line 279... Line 285...
279
		cbPrefixe.setFieldLabel("Prefix");
285
		cbPrefixe.setFieldLabel("Prefix");
Line 280... Line 286...
280
		
286
		
281
		fsNoms.add(cbPrefixe);
287
		fsNoms.add(cbPrefixe);
Line 282... Line 288...
282
		hmIdentite.put("cbPrefixe", cbPrefixe);
288
		hmIdentite.put("cbPrefixe", cbPrefixe);
Line 283... Line 289...
283
		
289
		
284
		mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
290
		mediateur.obtenirListeValeurEtRafraichir(this, "prefixe", sequenceur);
285
 
291
 
286
		//Prénom
292
		//Prénom
Line 311... Line 317...
311
		cbSuffixe.setEmptyText("Choisissez un suffixe:");
317
		cbSuffixe.setEmptyText("Choisissez un suffixe:");
Line 312... Line 318...
312
		
318
		
313
		fsNoms.add(cbSuffixe);			
319
		fsNoms.add(cbSuffixe);			
Line 314... Line 320...
314
		hmIdentite.put("cbSuffixe", cbSuffixe);
320
		hmIdentite.put("cbSuffixe", cbSuffixe);
Line 315... Line 321...
315
		
321
		
316
		mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
322
		mediateur.obtenirListeValeurEtRafraichir(this, "suffixes", sequenceur);
317
 
323
 
Line 482... Line 488...
482
		FormData fd = new FormData();
488
		FormData fd = new FormData();
483
		fd.setWidth(100);
489
		fd.setWidth(100);
484
		lcAutreInformations1.add(cbSexe, fd);			
490
		lcAutreInformations1.add(cbSexe, fd);			
485
		hmIdentite.put("cbSexe", cbSexe);
491
		hmIdentite.put("cbSexe", cbSexe);
Line 486... Line 492...
486
	
492
	
Line 487... Line 493...
487
		mediateur.obtenirListeValeurEtRafraichir(this, "sexe");			
493
		mediateur.obtenirListeValeurEtRafraichir(this, "sexe", sequenceur);			
488
		
494
		
489
		//Description
495
		//Description
490
		TextArea taDescription = new TextArea();
496
		TextArea taDescription = new TextArea();
Line 625... Line 631...
625
		
631
		
626
		right.add(tfVille, fd100);
632
		right.add(tfVille, fd100);
Line 627... Line 633...
627
		hmAdresse.put("tfVille", tfVille);
633
		hmAdresse.put("tfVille", tfVille);
628
		
634
		
Line 629... Line 635...
629
		// MAJ ComboBox
635
		// MAJ ComboBox
630
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
636
		mediateur.obtenirListeValeurEtRafraichir(this, "pays", sequenceur);
631
		
637
		
Line 968... Line 974...
968
	}
974
	}
Line 969... Line 975...
969
	
975
	
970
	private void mettreAJourRegion()	{
976
	private void mettreAJourRegion()	{
971
		//Met à jour la combo box en sélectionnant la valeur enregistrée pour la personne
977
		//Met à jour la combo box en sélectionnant la valeur enregistrée pour la personne
972
		ComboBox<Valeur> cbRegion = hmAdresse.getComboBoxValeur("cbRegion");
978
		ComboBox<Valeur> cbRegion = hmAdresse.getComboBoxValeur("cbRegion");
973
		if (personneSelectionnee.get("ce_truk_region").toString().startsWith("AUTRE##")) {
979
		if (personneSelectionnee.get("ce_truk_region")!=null && personneSelectionnee.get("ce_truk_region").toString().startsWith("AUTRE##")) {
974
			cbRegion.setRawValue(personneSelectionnee.get("ce_truk_region").toString().replaceFirst("^AUTRE##", ""));
980
			cbRegion.setRawValue(personneSelectionnee.get("ce_truk_region").toString().replaceFirst("^AUTRE##", ""));
975
		} else if (personneSelectionnee.get("ce_truk_region") != null && cbRegion.getStore().getCount() > 0)	{
981
		} else if (personneSelectionnee.get("ce_truk_region") != null && cbRegion.getStore().getCount() > 0)	{
976
			Valeur valeurRegion = cbRegion.getStore().findModel("id_valeur", personneSelectionnee.get("ce_truk_region"));
982
			Valeur valeurRegion = cbRegion.getStore().findModel("id_valeur", personneSelectionnee.get("ce_truk_region"));
977
			if (valeurRegion!=null)	{
983
			if (valeurRegion!=null)	{