Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 975 Rev 980
Line 15... Line 15...
15
import org.tela_botanica.client.util.UtilString;
15
import org.tela_botanica.client.util.UtilString;
16
import org.tela_botanica.client.vues.Formulaire;
16
import org.tela_botanica.client.vues.Formulaire;
17
import org.tela_botanica.client.vues.structure.StructureForm;
17
import org.tela_botanica.client.vues.structure.StructureForm;
Line 18... Line 18...
18
 
18
 
19
import com.extjs.gxt.ui.client.event.BaseEvent;
-
 
20
import com.extjs.gxt.ui.client.event.EventType;
19
import com.extjs.gxt.ui.client.event.BaseEvent;
21
import com.extjs.gxt.ui.client.event.Events;
20
import com.extjs.gxt.ui.client.event.Events;
22
import com.extjs.gxt.ui.client.event.Listener;
21
import com.extjs.gxt.ui.client.event.Listener;
23
import com.extjs.gxt.ui.client.widget.Info;
22
import com.extjs.gxt.ui.client.widget.Info;
24
import com.extjs.gxt.ui.client.widget.MessageBox;
23
import com.extjs.gxt.ui.client.widget.MessageBox;
Line 75... Line 74...
75
		nomChp  = new TextField<String>();
74
		nomChp  = new TextField<String>();
76
		nomChp.setTabIndex(tabIndex++);
75
		nomChp.setTabIndex(tabIndex++);
77
		nomChp.setFieldLabel(i18nC.nomCollection());
76
		nomChp.setFieldLabel(i18nC.nomCollection());
78
		nomChp.setAllowBlank(false);
77
		nomChp.setAllowBlank(false);
79
		nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
78
		nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
80
		nomChp.addListener(Events.Valid, new Listener<BaseEvent>() {
79
		nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
81
			@Override
-
 
82
			public void handleEvent(BaseEvent be) {
-
 
83
				nomChp.removeStyleName(ComposantClass.OBLIGATOIRE);
-
 
84
				nomChp.removeStyleName(ComposantClass.OBLIGATOIRE_OK);
-
 
85
				if (nomChp.getRawValue().length() != 0) {
-
 
86
					nomChp.addStyleName(ComposantClass.OBLIGATOIRE_OK);
-
 
87
				} else if (nomChp.getRawValue().length() == 0) {
-
 
88
					nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
-
 
89
				}
-
 
90
			}
-
 
91
		});
-
 
92
		nomChp.getMessages().setBlankText(i18nC.champObligatoire());
80
		nomChp.getMessages().setBlankText(i18nC.champObligatoire());
93
		principalFieldSet.add(nomChp, new FormData(450, 0));
81
		principalFieldSet.add(nomChp, new FormData(450, 0));
Line 94... Line 82...
94
		
82
		
95
		typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++);
83
		typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++);
Line 112... Line 100...
112
				}
100
				}
113
				mediateur.desactiverChargement();
101
				mediateur.desactiverChargement();
114
				panneauFormulaire.layout();
102
				panneauFormulaire.layout();
115
			}
103
			}
116
		});
104
		});
117
		typesCollectionCombo.addListener(Events.Valid, new Listener<BaseEvent>() {
105
		typesCollectionCombo.addListener(Events.Valid, creerEcouteurChampObligatoire());
118
			@Override
-
 
119
			public void handleEvent(BaseEvent be) {
-
 
120
				Valeur valeur = typesCollectionCombo.getValue();
-
 
121
				// Gestion du style obligatoire
-
 
122
				typesCollectionCombo.removeStyleName(ComposantClass.OBLIGATOIRE);
-
 
123
				typesCollectionCombo.removeStyleName(ComposantClass.OBLIGATOIRE_OK);
-
 
124
				if (valeur != null) {
-
 
125
					typesCollectionCombo.addStyleName(ComposantClass.OBLIGATOIRE_OK);
-
 
126
				} else {
-
 
127
					typesCollectionCombo.addStyleName(ComposantClass.OBLIGATOIRE);
-
 
128
				}
-
 
129
			}
-
 
130
		});
-
 
131
		principalFieldSet.add(typesCollectionCombo, new FormData(150, 0));
106
		principalFieldSet.add(typesCollectionCombo, new FormData(150, 0));
132
		typesCollectionCombo.fireEvent(Events.Select);
107
		typesCollectionCombo.fireEvent(Events.Select);
Line 133... Line 108...
133
		
108
		
134
		panneauFormulaire.setTopComponent(principalFieldSet);
109
		panneauFormulaire.setTopComponent(principalFieldSet);