use of org.asqatasun.webapp.form.CheckboxElement 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.getInstance().getFormFieldBuilderCopy(referentialParameter, sortFormFieldBuilderList);
if (isManualAudit) {
CheckboxFormFieldImpl ObjectList = (CheckboxFormFieldImpl) formFieldList.get(1);
List<CheckboxElement> checkboxElementList = ObjectList.getCheckboxElementList();
for (CheckboxElement checkboxElement : checkboxElementList) {
if (checkboxElement.getI18nKey().equals("nt")) {
checkboxElement.setSelected(true);
}
}
}
asuc = AuditResultSortCommandFactory.getInstance().getInitialisedAuditResultSortCommand(webResourceId, displayScope, isCriterionViewAccessible(webResourceId, referentialParameter), formFieldList);
} else {
formFieldList = AuditResultSortCommandFactory.getInstance().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);
}
use of org.asqatasun.webapp.form.CheckboxElement in project Asqatasun by Asqatasun.
the class CheckboxElementBuilderImpl method build.
@Override
public CheckboxElement build() {
CheckboxElement formField = new CheckboxElementImpl();
formField.setErrorI18nKey(getErrorI18nKey());
formField.setI18nKey(getI18nKey());
formField.setValue(getValue());
formField.setEnabled(isEnabled);
formField.setSelected(isSelected);
return formField;
}
Aggregations