How can I get the error message from qx.core.ValidationError

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I get the error message from qx.core.ValidationError

voger
I am trying to do some validation on "changeValue" but I can't get the
message that comes when the qx.coreValidationError is thrown.

Here is my event handler
             emailField.addListener("changeValue", function(e) {
                 try {
                     qx.util.Validate.checkEmail(e.getData, e.getTarget());
                 }
                 catch (err) {
                     var target = e.getTarget();
                     target.setValid(false);
                     console.log(err.toString());
                     target.setInvalidMessage(err.toString());
                 }
             }, this);

and this is what I get in console

Validation Error: 'function () {
       return this.__data;
     }' is not an email address.

but I want 'asdfter' is not an email address.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How can I get the error message from qx.core.ValidationError

voger
Sorry for the noise. It was a typo in
qx.util.Validate.checkEmail(e.getData, e.getTarget());

e.getData() should have parentheses.


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel