- Pull up the AJAX Control Toolkit Sample site’s Validator Callout example (here)
- Push submit
- Note that both fields are invalid, and the first field shows the Validator Callout
- Add text to the first TextBox
- Push submit
- The Validator Callout for the top text field is gone, the Validator Callout for the second TextBox is not shown but should be
This is the symptom identified by these 4 bug reports.
The problem? The Validator Callout set this._isOpen at the top of the show() method, but actually did the showing at the bottom of the method — after checking a few more things. So, when you push submit in step 2 above, it actually sets this._isOpen = true on both Validator Callouts even though only one is actually visible. Once you fix TextBox 1, and push submit, it runs through the validators again, notes #1 is now valid, and #2 is still invalid. It also notes that #2 says it’s visible, and doesn’t bother showing it.
The solution is uber-simple:
– Replace the get_isOpen() function at the bottom of ValidatorCalloutBehavior.js with this one, which actually checks if the pop-up is visible:
– Delete all lines that assign something to this._isOpen (e.g. this._isOpen = false;)
– Replace all lines that use this._isOpen with this.get_isOpen(). By my count, there are two such lines: one in show() and one in hide().
That’s it. It now no longer guesses if the validator is visible, it checks the table it created to see if it’s actually visible.