19,6 → 19,9 |
import org.tela_botanica.client.vues.Formulaire; |
import org.tela_botanica.client.vues.FormulaireOnglet; |
|
import com.extjs.gxt.ui.client.event.BaseEvent; |
import com.extjs.gxt.ui.client.event.Events; |
import com.extjs.gxt.ui.client.event.Listener; |
import com.extjs.gxt.ui.client.store.ListStore; |
import com.extjs.gxt.ui.client.util.Margins; |
import com.extjs.gxt.ui.client.widget.Text; |
120,6 → 123,22 |
}); |
projetsCombo.setTriggerAction(TriggerAction.ALL); |
projetsCombo.setStore(new ListStore<Projet>()); |
projetsCombo.addStyleName("obligatoire"); |
projetsCombo.addListener(Events.Select, new Listener<BaseEvent>() { |
@Override |
public void handleEvent(BaseEvent be) { |
Projet valeur = projetsCombo.getValue(); |
|
// Gestion du style obligatoire |
projetsCombo.removeStyleName("obligatoire"); |
projetsCombo.removeStyleName("obligatoire-ok"); |
if (valeur != null) { |
projetsCombo.addStyleName("obligatoire-ok"); |
} else { |
projetsCombo.addStyleName("obligatoire"); |
} |
} |
}); |
liaisonFieldSet.add(projetsCombo, new FormData(450, 0)); |
mediateur.selectionnerProjet(this, null); |
|
310,7 → 329,9 |
|
public ArrayList<String> verifier() { |
ArrayList<String> messages = new ArrayList<String>(); |
if (projetsCombo.getValue() == null || projetsCombo.getValue().equals("") || collection.getIdProjet().equals("")) { |
if (projetsCombo.getValue() == null |
|| projetsCombo.getValue().equals("") |
|| (mode.equals(Formulaire.MODE_MODIFIER) && collection != null && collection.getIdProjet().equals(""))) { |
messages.add("Veuillez sélectionner un projet pour la collection."); |
} |
return messages; |
320,7 → 341,7 |
initialiserCollection(); |
if (etreAccede()) { |
collectionCollectee.setId(idCollectionChp.getValue()); |
collectionCollectee.setCollectionMereId(getValeurComboProjets()); |
collectionCollectee.setIdProjet(getValeurComboProjets()); |
collectionCollectee.setIdStructure(getValeurComboStructures()); |
collectionCollectee.setCollectionMereId(getValeurComboCollections()); |
|
340,7 → 361,9 |
collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs()); |
|
collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur()); |
collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString()); |
if (nbreTypeChp.getValue() != null) { |
collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString()); |
} |
collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur()); |
collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur()); |
} |