On 6/10/10 1:05 AM, MartinWittemann wrote:
>
> Hello Greg,
> thats a thing we can not change easily. The validators supplied by the
> framework can be used for validation in the form context and for validation
> of properties. Thats why they have to throw a validation error because
> property validation can only handle exceptions which of course have a
> message set. The form checks if an exception is thrown and uses this message
> because something which came out of the actual check method should be more
> accurate than a message set on the widget itself. In the case of the
> predefined validators, this could be wrong. Maybe we should just supply an
> argument to give the message to the build in validators? That could solve
> the problem...
> Regards,
> Martin
Hi Martin,
I like your idea, perhaps something along the lines of:
regExp : function(reg, defaultmessage)
{
return function(value)
{
if (reg.test(value) === false)
{
if (defaultmessage) {
throw new qx.core.ValidationError("Validation Error",
qx.locale.Manager.tr(defaultmessage));
}
throw new qx.core.ValidationError(
"Validation Error", qx.locale.Manager.tr("%1 does not fit
%2.", value, reg)
);
}
}
}
Greg
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel