Hi,
I'm looking for a validator which only fires when the user changed a value. It should not validate existing values coming from the server (even when the user canEdit the field).
We always call form.validate() before any server interaction. When that happens, this validator should not run. Or run only when the value has changed.
As workaround we would add the validator on the field as usual, add some attribute onItemChanged to the field and let the validator check that property to see if it should run. The attribute needs to be reset after every server interaction then.
Is there something easier in the framework?
thanks,
com.smartgwt.client.widgets.form.validator.Validator.setValidateOnChange(Boolean) ::
If true, validator will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated.
If true, validator will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated.
We always call form.validate() before any server interaction. When that happens, this validator should not run. Or run only when the value has changed.
As workaround we would add the validator on the field as usual, add some attribute onItemChanged to the field and let the validator check that property to see if it should run. The attribute needs to be reset after every server interaction then.
Is there something easier in the framework?
thanks,
Comment