use of org.asqatasun.webapp.ui.form.NumericalFormField in project Asqatasun by Asqatasun.
the class NumericalFormFieldBuilderImpl method build.
@Override
public NumericalFormField build() {
NumericalFormField formField = new NumericalFormField();
formField.setErrorI18nKey(getErrorI18nKey());
formField.setI18nKey(getI18nKey());
formField.setValue(getValue());
formField.setMaxValue(maxValue);
formField.setMinValue(minValue);
return formField;
}
use of org.asqatasun.webapp.ui.form.NumericalFormField in project Asqatasun by Asqatasun.
the class AuditSetUpFormFieldHelper method applyRestrictionToAuditSetUpFormField.
/**
* A restriction can be applied to an AuditSetUpFormField when an option
* matches with a parameter (by its code). In this case, regarding the type
* of the FormField, the value of the option override the default
*
* @param ap
* @param optionElementSet
*/
public void applyRestrictionToAuditSetUpFormField(AuditSetUpFormField ap, Collection<OptionElementImpl> optionElementSet) {
if (ap.getFormField() instanceof NumericalFormField) {
OptionElementImpl optionElement = getOptionFromOptionSet(optionElementSet, ap.getParameterElement().getParameterElementCode());
if (optionElement != null) {
((NumericalFormField) ap.getFormField()).setMaxValue(optionElement.getValue());
ap.getFormField().setValue(optionElement.getValue());
}
} else if (ap.getFormField() instanceof SelectFormField) {
activateSelectFormField((SelectFormField) ap.getFormField(), optionElementSet);
} else if (ap.getFormField() instanceof TextualFormField) {
OptionElementImpl optionElement = getOptionFromOptionSet(optionElementSet, ap.getParameterElement().getParameterElementCode());
if (optionElement != null) {
(ap.getFormField()).setValue(optionElement.getValue());
}
}
}
Aggregations