Hi Isomorphic,
ValuesManager.checkForValidationErrors() is not working propely if there is validation error for some field. If "Map errorMap" is null then it's working fine.
SmartClient Version: v12.0p_2020-03-11/PowerEdition Deployment (built 2020-03-11)
Exception:
Client side:
This way I set validation error:
.ds.xml
Best,
Pavo
ValuesManager.checkForValidationErrors() is not working propely if there is validation error for some field. If "Map errorMap" is null then it's working fine.
SmartClient Version: v12.0p_2020-03-11/PowerEdition Deployment (built 2020-03-11)
Exception:
Code:
[ERROR] [lms] Uncaught exception escaped
java.lang.IllegalArgumentException: convertToMap - unable to convert the passed JavaScript object to a Map. JavaScript is: [Obj
]
at com.smartgwt.client.util.JSOHelper.convertToMap(JSOHelper.java:805)
at com.smartgwt.client.util.JSOHelper.convertToMap(JSOHelper.java:819)
Code:
valuesManager.checkForValidationErrors(new ValidationStatusCallback() {
@Override
public void execute(Map errorMap) {
// TODO Auto-generated method stub
}
});
Code:
public class ValidatorPasswordMinMaxLength {
public boolean condition(Object value, Validator validator, String fieldName, @SuppressWarnings("rawtypes") Map record, DataSource ds,
HttpServletRequest httpServletRequest) throws Exception {
validator.addErrorMessageVariable("errorMessage", "Test");
return false;
}
}
Code:
<field name="INTERN_PASSWORD_MAX_LENGTH" type="integer" required="true">
<validators>
<validator type="integerRange" min="4" max="60" />
<validator type="serverCustom" serverOnly="true">
<serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.validator.ValidatorPasswordMinMaxLength" />
<errorMessage>$errorMessage</errorMessage>
</validator>
</validators>
</field>
Pavo
Comment