Search in sources :

Example 1 with CheckboxFormField

use of org.asqatasun.webapp.ui.form.CheckboxFormField in project Asqatasun by Asqatasun.

the class AbstractAuditResultController method prepareDataForSortConsole.

/**
 * This method prepares the data to be displayed in the sort (referential,
 * theme, result types) console of the result page.
 *
 * @param webResourceId
 * @param displayScope
 * @param auditResultSortCommand
 * @param model
 * @param isManualAudit
 */
private void prepareDataForSortConsole(Long webResourceId, String displayScope, AuditResultSortCommand auditResultSortCommand, Model model, boolean isManualAudit) {
    // Meta-statistics have been added to the method previously
    String referentialParameter = ((AuditStatistics) model.asMap().get(TgolKeyStore.STATISTICS_KEY)).getParametersMap().get(TgolKeyStore.REFERENTIAL_PARAM_KEY);
    AuditResultSortCommand asuc;
    List<FormField> formFieldList;
    if (auditResultSortCommand == null) {
        formFieldList = auditResultSortCommandFactory.getFormFieldBuilderCopy(referentialParameter, sortFormFieldBuilderList);
        if (isManualAudit) {
            CheckboxFormField ObjectList = (CheckboxFormField) formFieldList.get(1);
            List<CheckboxElement> checkboxElementList = ObjectList.getCheckboxElementList();
            for (CheckboxElement checkboxElement : checkboxElementList) {
                if (checkboxElement.getI18nKey().equals("nt")) {
                    checkboxElement.setSelected(true);
                }
            }
        }
        asuc = auditResultSortCommandFactory.getInitialisedAuditResultSortCommand(webResourceId, displayScope, isCriterionViewAccessible(webResourceId, referentialParameter), formFieldList);
    } else {
        formFieldList = auditResultSortCommandFactory.getFormFieldBuilderCopy(referentialParameter, sortFormFieldBuilderList, auditResultSortCommand);
        asuc = auditResultSortCommand;
    }
    model.addAttribute(TgolKeyStore.AUDIT_RESULT_SORT_FIELD_LIST_KEY, formFieldList);
    model.addAttribute(TgolKeyStore.AUDIT_RESULT_SORT_COMMAND_KEY, asuc);
}
Also used : CheckboxFormField(org.asqatasun.webapp.ui.form.CheckboxFormField) AuditResultSortCommand(org.asqatasun.webapp.command.AuditResultSortCommand) CheckboxFormField(org.asqatasun.webapp.ui.form.CheckboxFormField) FormField(org.asqatasun.webapp.ui.form.FormField) CheckboxElement(org.asqatasun.webapp.ui.form.CheckboxElement)

Example 2 with CheckboxFormField

use of org.asqatasun.webapp.ui.form.CheckboxFormField in project Asqatasun by Asqatasun.

the class CheckboxFormFieldBuilderImpl method build.

@Override
public CheckboxFormField build() {
    CheckboxFormField formField = new CheckboxFormField();
    formField.setErrorI18nKey(getErrorI18nKey());
    formField.setI18nKey(getI18nKey());
    formField.setValue(getValue());
    formField.setRestrictionCode(restrictionCode);
    formField.setCode(code);
    formField.setActivationCode(activationCode);
    formField.setCheckboxElementList(getCheckboxElementList());
    return formField;
}
Also used : CheckboxFormField(org.asqatasun.webapp.ui.form.CheckboxFormField)

Aggregations

CheckboxFormField (org.asqatasun.webapp.ui.form.CheckboxFormField)2 AuditResultSortCommand (org.asqatasun.webapp.command.AuditResultSortCommand)1 CheckboxElement (org.asqatasun.webapp.ui.form.CheckboxElement)1 FormField (org.asqatasun.webapp.ui.form.FormField)1