On Tue, Jul 17, 2012 at 7:51 PM, Scott Chapman <sc...@mischko.com> wrote:

> Can someone please explain how to use the "number" validator if form field
> returns string only?


It can be used for properties, such as in the validation test case:

      age :
      {
          init:  18,
          validate: qx.util.Validate.number()
      },

Now, a call of setAge(23) will work, but a call of setAge("42") will fail
to validate.

I had forgotten about the "validate" key for properties. It's very similar
to the "check" property (although the means of reporting a validation
failure differs between the two). "check" is optimized out in the 'build'
version. I believe that "validate" is not, so it allows validation to take
place even in the deployed application. This would make sense for
properties which are actually part of a data model, and I imagine that's
its primary use.

Derrell
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to