Community
Participate
Working Groups
The validation rule map is not correctly created by Scout SDK for replaced form fields if the rule's value evaluates to false or null. Example (simplified): BaseForm: public class NameField extends AbstractStringField { @Override protected boolean getConfiguredMandatory() { return true; } } Creates the following rule map in the form field data @Override protected void initValidationRules(java.util.Map<String, Object> ruleMap) { super.initValidationRules(ruleMap); ruleMap.put(ValidationRule.MANDATORY, true); } ExtendedForm extends BaseForm: @Replace public class NameExField extends BaseForm.MainBox.GroupBox.NameField { @Override protected boolean getConfiguredMandatory() { return false; } } The rule map in the extended form field data is empty, but it should have the following contents: @Override protected void initValidationRules(java.util.Map<String, Object> ruleMap) { super.initValidationRules(ruleMap); ruleMap.remove(ValidationRule.MANDATORY); } Note: Whenever a overridden rule evaluates to false or null, it is removed from the rule map. In all other cases, the rule is overridden with its new value.
Created attachment 231337 [details] applied patch
committed on Scout branch 3.8. Will be merged by Stephan or ken to Scout branch 3.9
Has been pushed as change (https://git.eclipse.org/r/#/c/13103/) and committed to master: d994a9f414d22452035d36ddc82d6c25d6fa37c2 (http://git.eclipse.org/c/scout/org.eclipse.scout.rt.git/commit/?id=d994a9f414d22452035d36ddc82d6c25d6fa37c2) @Andi: Please verify
Bug closed, shipped with 3.9.0 (Kepler)