Hi,

hkalyoncu wrote:
> 
> it would be nice to set it like: 
> textField.setRequired("custom message"); 
> 

If you use the trunk of qooxdoo, you should be able to use the translation
to configure the "This field is required". We recently added the translation
feature to the manager. But you are right, that could be made configurable
as a property ore something like this on the manager. I opened up a bug
report for that issue: http://bugzilla.qooxdoo.org/show_bug.cgi?id=3443


hkalyoncu wrote:
> 
> another thing: 
> i cannot use this.tr() or self.tr() methods in manager.setValidator()
> method 
> on runtime i got the error "this.tr() is not a function"
> 

If this.tr is not working, you can always use qx.locale.Manager.tr. Maybe
the context (this) was wrong in the case you tried it.


hkalyoncu wrote:
> 
> following is from framework
> framework/source/class/qx/ui/form/validation/Manager.js:
> 
>       // check for the data type
>       if (this.__supportsSingleSelection(formItem)) {
>         // check for a validator
>         if (validator != null) {
>           throw new Error("Widgets suporting selection can only be
> validated " +
>           "in the form validator");
>         }
> 
> is this code true? i think the logic in the second if is wrong.
> it must be 
> if (validator == null)
> am i wrong?
> 
No that code is exactly the way it should be. As the method documentation
says, the added widgets need to implement two interfaces and thats not true
for the SelectBox. The main thought behind this is the idea that its easy to
validate atomic values. But a select box has no atomic value like a string
or a boolean. It has a selection which can have (in a list for example)
null, one or more items in it. So you alway need the context to validate the
widgets using the selection. Thats why we choose to keep the validation of a
select box in the validation method of the manager itself so it can always
access the whole content.

Regards,
Martin
-- 
View this message in context: 
http://n2.nabble.com/form-validator-custom-required-field-tp4575237p4580534.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to