Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    com.smartgwt.client.widgets.form.ValuesManager.checkForValidationErrors() exception

    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:
    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)
    Client side:
    Code:
                            valuesManager.checkForValidationErrors(new ValidationStatusCallback() {
                                @Override
                                public void execute(Map errorMap) {
                                    // TODO Auto-generated method stub
    
                                }
                            });
    This way I set validation error:
    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;
    
        }
    }
    .ds.xml
    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>
    Best,
    Pavo

    #2
    This should be fixed back to SGWT/SC 12.0p in the nightly builds dated 2020-05-03.

    Comment

    Working...
    X