Line 17... |
Line 17... |
17 |
import org.tela_botanica.client.modeles.structure.StructureListe;
|
17 |
import org.tela_botanica.client.modeles.structure.StructureListe;
|
18 |
import org.tela_botanica.client.util.Debug;
|
18 |
import org.tela_botanica.client.util.Debug;
|
19 |
import org.tela_botanica.client.vues.Formulaire;
|
19 |
import org.tela_botanica.client.vues.Formulaire;
|
20 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
20 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
Line -... |
Line 21... |
- |
|
21 |
|
- |
|
22 |
import com.extjs.gxt.ui.client.event.BaseEvent;
|
- |
|
23 |
import com.extjs.gxt.ui.client.event.Events;
|
21 |
|
24 |
import com.extjs.gxt.ui.client.event.Listener;
|
22 |
import com.extjs.gxt.ui.client.store.ListStore;
|
25 |
import com.extjs.gxt.ui.client.store.ListStore;
|
23 |
import com.extjs.gxt.ui.client.util.Margins;
|
26 |
import com.extjs.gxt.ui.client.util.Margins;
|
24 |
import com.extjs.gxt.ui.client.widget.Text;
|
27 |
import com.extjs.gxt.ui.client.widget.Text;
|
25 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
28 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
Line 118... |
Line 121... |
118 |
return retour;
|
121 |
return retour;
|
119 |
}
|
122 |
}
|
120 |
});
|
123 |
});
|
121 |
projetsCombo.setTriggerAction(TriggerAction.ALL);
|
124 |
projetsCombo.setTriggerAction(TriggerAction.ALL);
|
122 |
projetsCombo.setStore(new ListStore<Projet>());
|
125 |
projetsCombo.setStore(new ListStore<Projet>());
|
- |
|
126 |
projetsCombo.addStyleName("obligatoire");
|
- |
|
127 |
projetsCombo.addListener(Events.Select, new Listener<BaseEvent>() {
|
- |
|
128 |
@Override
|
- |
|
129 |
public void handleEvent(BaseEvent be) {
|
- |
|
130 |
Projet valeur = projetsCombo.getValue();
|
- |
|
131 |
|
- |
|
132 |
// Gestion du style obligatoire
|
- |
|
133 |
projetsCombo.removeStyleName("obligatoire");
|
- |
|
134 |
projetsCombo.removeStyleName("obligatoire-ok");
|
- |
|
135 |
if (valeur != null) {
|
- |
|
136 |
projetsCombo.addStyleName("obligatoire-ok");
|
- |
|
137 |
} else {
|
- |
|
138 |
projetsCombo.addStyleName("obligatoire");
|
- |
|
139 |
}
|
- |
|
140 |
}
|
- |
|
141 |
});
|
123 |
liaisonFieldSet.add(projetsCombo, new FormData(450, 0));
|
142 |
liaisonFieldSet.add(projetsCombo, new FormData(450, 0));
|
124 |
mediateur.selectionnerProjet(this, null);
|
143 |
mediateur.selectionnerProjet(this, null);
|
Line 125... |
Line 144... |
125 |
|
144 |
|
126 |
structuresCombo = new ComboBox<Structure>();
|
145 |
structuresCombo = new ComboBox<Structure>();
|
Line 308... |
Line 327... |
308 |
}
|
327 |
}
|
309 |
}
|
328 |
}
|
Line 310... |
Line 329... |
310 |
|
329 |
|
311 |
public ArrayList<String> verifier() {
|
330 |
public ArrayList<String> verifier() {
|
- |
|
331 |
ArrayList<String> messages = new ArrayList<String>();
|
- |
|
332 |
if (projetsCombo.getValue() == null
|
312 |
ArrayList<String> messages = new ArrayList<String>();
|
333 |
|| projetsCombo.getValue().equals("")
|
313 |
if (projetsCombo.getValue() == null || projetsCombo.getValue().equals("") || collection.getIdProjet().equals("")) {
|
334 |
|| (mode.equals(Formulaire.MODE_MODIFIER) && collection != null && collection.getIdProjet().equals(""))) {
|
314 |
messages.add("Veuillez sélectionner un projet pour la collection.");
|
335 |
messages.add("Veuillez sélectionner un projet pour la collection.");
|
315 |
}
|
336 |
}
|
316 |
return messages;
|
337 |
return messages;
|
Line 317... |
Line 338... |
317 |
}
|
338 |
}
|
318 |
|
339 |
|
319 |
public void collecter() {
|
340 |
public void collecter() {
|
320 |
initialiserCollection();
|
341 |
initialiserCollection();
|
321 |
if (etreAccede()) {
|
342 |
if (etreAccede()) {
|
322 |
collectionCollectee.setId(idCollectionChp.getValue());
|
343 |
collectionCollectee.setId(idCollectionChp.getValue());
|
323 |
collectionCollectee.setCollectionMereId(getValeurComboProjets());
|
344 |
collectionCollectee.setIdProjet(getValeurComboProjets());
|
Line 324... |
Line 345... |
324 |
collectionCollectee.setIdStructure(getValeurComboStructures());
|
345 |
collectionCollectee.setIdStructure(getValeurComboStructures());
|
325 |
collectionCollectee.setCollectionMereId(getValeurComboCollections());
|
346 |
collectionCollectee.setCollectionMereId(getValeurComboCollections());
|
Line 338... |
Line 359... |
338 |
collectionCollectee.setGroupementPrincipe(groupementPrincipeCombo.getValeur());
|
359 |
collectionCollectee.setGroupementPrincipe(groupementPrincipeCombo.getValeur());
|
339 |
collectionCollectee.setGroupementBut(butRealisationCombo.getValeur());
|
360 |
collectionCollectee.setGroupementBut(butRealisationCombo.getValeur());
|
340 |
collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs());
|
361 |
collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs());
|
Line 341... |
Line 362... |
341 |
|
362 |
|
- |
|
363 |
collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur());
|
342 |
collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur());
|
364 |
if (nbreTypeChp.getValue() != null) {
|
- |
|
365 |
collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString());
|
343 |
collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString());
|
366 |
}
|
344 |
collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur());
|
367 |
collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur());
|
345 |
collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur());
|
368 |
collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur());
|
346 |
}
|
369 |
}
|