use of fr.univlorraine.ecandidat.vaadin.form.RequiredTextField in project esup-ecandidat by EsupPortail.
the class AdresseForm method initForm.
/**
*Initialise le formulaire
* @param fieldGroupAdresse
*/
private void initForm(CustomBeanFieldGroup<Adresse> fieldGroupAdresse) {
Adresse adresse = fieldGroupAdresse.getItemDataSource().getBean();
/*Champs commune etrangere*/
RequiredTextField adr1Adrfield = (RequiredTextField) fieldGroupAdresse.getField(Adresse_.adr1Adr.getName());
changeRequired(adr1Adrfield, true);
/*Champs commune*/
ComboBoxCommune communeField = (ComboBoxCommune) fieldGroupAdresse.getField(Adresse_.siScolCommune.getName());
/*Champs code postal*/
RequiredIntegerField bdiField = (RequiredIntegerField) fieldGroupAdresse.getField(Adresse_.codBdiAdr.getName());
/*Champs commune etrangere*/
RequiredTextField communeEtrfield = (RequiredTextField) fieldGroupAdresse.getField(Adresse_.libComEtrAdr.getName());
/*Champs pays*/
ComboBoxPays paysField = (ComboBoxPays) fieldGroupAdresse.getField(Adresse_.siScolPays.getName());
/*ajout des listeners*/
/*Champs code postal*/
bdiField.addValueChangeListener(event -> {
String val = (String) event.getProperty().getValue();
initBdi(val, communeField, null);
});
/*Champs pays*/
paysField.addValueChangeListener(e -> {
SiScolPays pays = (SiScolPays) e.getProperty().getValue();
initPays(pays, communeField, bdiField, communeEtrfield);
});
if (adresse.getIdAdr() == null || adresse.getSiScolPays() == null) {
paysField.setValue(cacheController.getPaysFrance());
} else {
paysField.setValue(adresse.getSiScolPays());
initPays(adresse.getSiScolPays(), communeField, bdiField, communeEtrfield);
}
if (adresse.getIdAdr() != null && adresse.getCodBdiAdr() != null) {
initBdi(adresse.getCodBdiAdr(), communeField, adresse.getSiScolCommune() != null ? adresse.getSiScolCommune() : null);
} else {
initBdi(null, communeField, null);
}
}
use of fr.univlorraine.ecandidat.vaadin.form.RequiredTextField in project esup-ecandidat by EsupPortail.
the class CtrCandFormationWindow method majFieldDip.
/**
* Mise a jour des champs de diplome
*/
private void majFieldDip() {
RequiredTextField rtfCodEtpVetApo = (RequiredTextField) fieldGroup.getField(Formation_.codEtpVetApoForm.getName());
RequiredTextField rtfCodVrsVetApo = (RequiredTextField) fieldGroup.getField(Formation_.codVrsVetApoForm.getName());
RequiredTextField rtfCodDipApo = (RequiredTextField) fieldGroup.getField(Formation_.codDipApoForm.getName());
RequiredTextField rtfCodVrsDdiApo = (RequiredTextField) fieldGroup.getField(Formation_.codVrsVdiApoForm.getName());
RequiredTextField rtfLibDipApoo = (RequiredTextField) fieldGroup.getField(Formation_.libDipApoForm.getName());
if (rtfCodDipApo == null || rtfCodVrsDdiApo == null || rtfLibDipApoo == null || btnApoAssociateDip == null) {
return;
}
if (rtfCodEtpVetApo.getValue() != null && rtfCodVrsVetApo.getValue() != null) {
rtfCodDipApo.setVisible(true);
rtfCodVrsDdiApo.setVisible(true);
rtfLibDipApoo.setVisible(true);
if (rtfCodDipApo.getValue() != null && rtfCodVrsDdiApo.getValue() != null) {
btnApoAssociateDip.setVisible(false);
btnApoDissociateDip.setVisible(true);
} else {
btnApoAssociateDip.setVisible(true);
btnApoDissociateDip.setVisible(false);
}
} else {
rtfCodVrsDdiApo.setVisible(false);
rtfLibDipApoo.setVisible(false);
rtfCodDipApo.setVisible(false);
rtfCodVrsDdiApo.setVisible(false);
rtfLibDipApoo.setVisible(false);
btnApoAssociateDip.setVisible(false);
btnApoDissociateDip.setVisible(false);
}
}
use of fr.univlorraine.ecandidat.vaadin.form.RequiredTextField in project esup-ecandidat by EsupPortail.
the class CtrCandActionCandidatureWindow method majAvisComponent.
/**
* Mise à jour des composants pour les avis
*/
private void majAvisComponent() {
final ComboBoxTypeDecision cbTypeDecision = (ComboBoxTypeDecision) fieldGroupDecision.getField(TypeDecisionCandidature_.typeDecision.getName());
final ComboBoxMotivationAvis cbMotivation = (ComboBoxMotivationAvis) fieldGroupDecision.getField(TypeDecisionCandidature_.motivationAvis.getName());
final RequiredIntegerField fieldRang = (RequiredIntegerField) fieldGroupDecision.getField(TypeDecisionCandidature_.listCompRangTypDecCand.getName());
final RequiredTextField fieldLieuPreselect = (RequiredTextField) fieldGroupDecision.getField(TypeDecisionCandidature_.preselectLieuTypeDecCand.getName());
final RequiredDateField fieldDatePreselect = (RequiredDateField) fieldGroupDecision.getField(TypeDecisionCandidature_.preselectDateTypeDecCand.getName());
final RequiredCheckBox fieldAppel = (RequiredCheckBox) fieldGroupDecision.getField(TypeDecisionCandidature_.temAppelTypeDecCand.getName());
final LocalTimeField fieldHeurePreselect = (LocalTimeField) fieldGroupDecision.getField(TypeDecisionCandidature_.preselectHeureTypeDecCand.getName());
final RequiredTextArea fieldComment = (RequiredTextArea) fieldGroupDecision.getField(TypeDecisionCandidature_.commentTypeDecCand.getName());
if (cbTypeDecision.getValue() != null) {
if (candidature != null && candidature.getLastTypeDecision() != null && candidature.getLastTypeDecision().getTemValidTypeDecCand() && candidature.getLastTypeDecision().getTypeDecision().getTemDefinitifTypDec() && parametreController.getIsAppel()) {
fieldAppel.setVisible(true);
} else {
fieldAppel.setVisible(false);
fieldAppel.setValue(false);
}
fieldComment.setVisible(true);
final TypeDecision typeDecision = (TypeDecision) cbTypeDecision.getValue();
if (typeDecision.getTypeAvis().getCodTypAvis().equals(NomenclatureUtils.TYP_AVIS_DEF)) {
cbMotivation.setBoxNeeded(true, null);
} else {
cbMotivation.setBoxNeeded(false, null);
}
if (typeDecision.getTypeAvis().getCodTypAvis().equals(NomenclatureUtils.TYP_AVIS_LISTE_COMP)) {
fieldRang.setVisible(true);
fieldRang.setRequired(true);
fieldRang.setRequiredError(applicationContext.getMessage("validation.obigatoire", null, UI.getCurrent().getLocale()));
} else {
fieldRang.setVisible(false);
fieldRang.setRequired(false);
fieldRang.setRequiredError(null);
fieldRang.setValue(null);
}
if (typeDecision.getTypeAvis().getCodTypAvis().equals(NomenclatureUtils.TYP_AVIS_PRESELECTION)) {
fieldLieuPreselect.setVisible(true);
fieldDatePreselect.setVisible(true);
fieldHeurePreselect.setVisible(true);
if (candidature != null) {
fieldLieuPreselect.setValue(candidature.getFormation().getPreselectLieuForm());
fieldDatePreselect.setValue((candidature.getFormation().getPreselectDateForm() != null) ? Date.valueOf(candidature.getFormation().getPreselectDateForm()) : null);
fieldHeurePreselect.setValue(candidature.getFormation().getPreselectHeureForm());
} else {
fieldLieuPreselect.setValue(null);
fieldDatePreselect.setValue(null);
fieldHeurePreselect.setValue(null);
}
} else {
fieldLieuPreselect.setVisible(false);
fieldDatePreselect.setVisible(false);
fieldHeurePreselect.setVisible(false);
}
} else {
cbMotivation.setBoxNeeded(false, null);
fieldRang.setVisible(false);
fieldRang.setRequired(false);
fieldRang.setRequiredError(null);
fieldRang.setValue(null);
fieldLieuPreselect.setVisible(false);
fieldDatePreselect.setVisible(false);
fieldHeurePreselect.setVisible(false);
fieldLieuPreselect.setValue(null);
fieldDatePreselect.setValue(null);
fieldHeurePreselect.setValue(null);
fieldAppel.setVisible(false);
fieldAppel.setValue(false);
fieldComment.setValue(null);
fieldComment.setVisible(false);
}
center();
}
Aggregations