Opened 9 years ago

Closed 6 years ago

#17436 closed enhancement (patchwelcome)

ValidationTextBox validates after change event

Reported by: Stefan Meyer Owned by:
Priority: undecided Milestone: 1.13
Component: Dijit - Form Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:


I am working on a three layer validation library based dojo.

layer 1: validation while user types. This is supported by some dijits.

layer 2: widget is bound to model. The converter validates the input and prevents the writing to the model. Converter validation is not needed, if the dijit has already validated the input.

layer 3: model validation will validate the relationship between a group of properties/widgets. This validation will only be performed when all the individual properties are valid.

Here is my problem: When the user changes the input and all properties are valid, the model validation should be triggered. Unfortunately the change event is sent before the validation is performed by the dijits. The code is something like this:

set("value", input); /* send the change event */ validate(); /* validate this.value */

Therefore I had to use a timeout of 0 millis after the individual change event to start model validation. Otherwise my model validation might either validate the relationship of individually invalid properties or its error message (e.g. dijit.message/dijit.state) will be overwritten by the individual error message.

Another issue:

I had to override all error indicators in the validating dijits. Because some dijits don't have these indicators and some can't because they don't provide a usefull event to display the message (like Checkboxes). While the individual value of a checkbox cannot be wrong, you often have to indicate that the checkbox must be selected for some reason.

It would be useful to easily switch off the error indicators in the validating dijits.

Change History (2)

comment:1 Changed 9 years ago by Stefan Meyer

Version 0, edited 9 years ago by Stefan Meyer (next)

comment:2 Changed 6 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in the past 2+ years, I'm closing this as patchwelcome. Please let us know if you would like to get involved in helping make this change to Dojo!

Note: See TracTickets for help on using tickets.