Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 979 → Rev 980

/trunk/src/org/tela_botanica/client/vues/collection/CollectionForm.java
17,7 → 17,6
import org.tela_botanica.client.vues.structure.StructureForm;
 
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.Info;
77,18 → 76,7
nomChp.setFieldLabel(i18nC.nomCollection());
nomChp.setAllowBlank(false);
nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
nomChp.addListener(Events.Valid, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
nomChp.removeStyleName(ComposantClass.OBLIGATOIRE);
nomChp.removeStyleName(ComposantClass.OBLIGATOIRE_OK);
if (nomChp.getRawValue().length() != 0) {
nomChp.addStyleName(ComposantClass.OBLIGATOIRE_OK);
} else if (nomChp.getRawValue().length() == 0) {
nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
}
}
});
nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
nomChp.getMessages().setBlankText(i18nC.champObligatoire());
principalFieldSet.add(nomChp, new FormData(450, 0));
114,20 → 102,7
panneauFormulaire.layout();
}
});
typesCollectionCombo.addListener(Events.Valid, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
Valeur valeur = typesCollectionCombo.getValue();
// Gestion du style obligatoire
typesCollectionCombo.removeStyleName(ComposantClass.OBLIGATOIRE);
typesCollectionCombo.removeStyleName(ComposantClass.OBLIGATOIRE_OK);
if (valeur != null) {
typesCollectionCombo.addStyleName(ComposantClass.OBLIGATOIRE_OK);
} else {
typesCollectionCombo.addStyleName(ComposantClass.OBLIGATOIRE);
}
}
});
typesCollectionCombo.addListener(Events.Valid, creerEcouteurChampObligatoire());
principalFieldSet.add(typesCollectionCombo, new FormData(150, 0));
typesCollectionCombo.fireEvent(Events.Select);