Search in sources :

Example 1 with RequiredCheckBox

use of fr.univlorraine.ecandidat.vaadin.form.RequiredCheckBox 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();
}
Also used : ComboBoxTypeDecision(fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxTypeDecision) TypeDecision(fr.univlorraine.ecandidat.entities.ecandidat.TypeDecision) RequiredCheckBox(fr.univlorraine.ecandidat.vaadin.form.RequiredCheckBox) ComboBoxMotivationAvis(fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxMotivationAvis) RequiredTextArea(fr.univlorraine.ecandidat.vaadin.form.RequiredTextArea) RequiredDateField(fr.univlorraine.ecandidat.vaadin.form.RequiredDateField) LocalTimeField(fr.univlorraine.ecandidat.vaadin.form.LocalTimeField) RequiredTextField(fr.univlorraine.ecandidat.vaadin.form.RequiredTextField) RequiredIntegerField(fr.univlorraine.ecandidat.vaadin.form.RequiredIntegerField) ComboBoxTypeDecision(fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxTypeDecision)

Example 2 with RequiredCheckBox

use of fr.univlorraine.ecandidat.vaadin.form.RequiredCheckBox in project esup-ecandidat by EsupPortail.

the class PieceJustifWindow method addFieldDescriptionCb.

/**
 * @param name
 */
private void addFieldDescriptionCb(final String property) {
    RequiredCheckBox rcb = (RequiredCheckBox) fieldGroup.getField(property);
    rcb.setDescription(applicationContext.getMessage("pieceJustif.info." + property, null, UI.getCurrent().getLocale()));
    rcb.setIcon(FontAwesome.INFO_CIRCLE);
}
Also used : RequiredCheckBox(fr.univlorraine.ecandidat.vaadin.form.RequiredCheckBox)

Aggregations

RequiredCheckBox (fr.univlorraine.ecandidat.vaadin.form.RequiredCheckBox)2 TypeDecision (fr.univlorraine.ecandidat.entities.ecandidat.TypeDecision)1 LocalTimeField (fr.univlorraine.ecandidat.vaadin.form.LocalTimeField)1 RequiredDateField (fr.univlorraine.ecandidat.vaadin.form.RequiredDateField)1 RequiredIntegerField (fr.univlorraine.ecandidat.vaadin.form.RequiredIntegerField)1 RequiredTextArea (fr.univlorraine.ecandidat.vaadin.form.RequiredTextArea)1 RequiredTextField (fr.univlorraine.ecandidat.vaadin.form.RequiredTextField)1 ComboBoxMotivationAvis (fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxMotivationAvis)1 ComboBoxTypeDecision (fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxTypeDecision)1