How to refresh RequiredInvalidMessage on demand?

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

How to refresh RequiredInvalidMessage on demand?

voger
I have a text field whose value is associated with a select box. When
the select box selection changes the meaning of the value of the texbox
changes also. I would like to provide an error message relevant to that
new meaning. I modified this example from the demo browser to show what
I mean. http://tinyurl.com/preq489
My code starts in line 67 and ends in line 83.

In this example an event listener is attached to the select box. Every
time the select box changes selection the event handler calls the
setRequiredInvalidMessage of nameTextfield to modify that property.
Unfortunately if we hover above the nameTextfield the tooltip still
shows the old message. If we press the send button the form is validated
and the error message is updated.

I would like to know if it is possible to make available the new message
in nameTextField's tootlip without having to validate the whole form
every time. If somehow we could call validate() in on specific item it
would be great. Any other option is welcome.

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to refresh RequiredInvalidMessage on demand?

rsantiagopaz
voger wrote
I would like to provide an error message relevant to that
new meaning.
<(sorry the english!!)>

if you select a item AND fill the textbox, the error message is not relevant again. So, why not call manager.validate() ?
Or you can subclass qx.ui.form.validation.Manager, override validate() method to use in particular item.
I hope this little helps.

</(sorry the english again!!)>
Reply | Threaded
Open this post in threaded view
|

Re: How to refresh RequiredInvalidMessage on demand?

voger
On 30/08/2015 05:58 μμ, rsantiagopaz wrote:

> voger wrote
>> I would like to provide an error message relevant to that
>> new meaning.
>
> <(sorry the english!!)>
>
> if you select a item AND fill the textbox, the error message is not relevant
> again. So, why not call manager.validate() ?
> Or you can subclass qx.ui.form.validation.Manager, override validate()
> method to use in particular item.
> I hope this little helps.
>
> </(sorry the english again!!)>
>
>

Hi, thanks for your help and sorry for the late reply. I haven't been
around. I am not calling the manager.validate() because that would
validate the whole form. I am trying to do something like validation on
the fly. Every time a value changes on a field I want to validate that
field only, maybe in combination with another relevant field. I don't
want red boxes popping in fields where the user has not visited yet. And
I have read the validation.Manager class and unfortunately it was a bit
difficult for me to understand some things it did. Maybe I should read
it again with a clearer mind. But still I would like to find a solution
using the qooxdoo vanilla API and not have to subclass for such a
(seemingly) trivial thing.




------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel