power-media / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

TActiveCustomValidator and Display=Dynamic not work anymore #417

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Copy sample code from here: 
http://www.pradosoft.com/demos/quickstart/?page=ViewSource&path=/ActiveControls/
Samples/TActiveCustomValidator/Home.page
2. Add Display="Dynamic" attribute to TActiveCustomValidator -component
3. Open test page
4. Hit submit button

What is the expected output? 
Error message should remain into view.

What do you see instead?
Error message will flash visible, but will go into hiding almost immediately.

What version of the product are you using? On what operating system?
Prado 3.2.0
Mac Os X / Firefox 14

Original issue reported on code.google.com by sampsa.s...@inoob.com on 27 Jul 2012 at 9:19

GoogleCodeExporter commented 8 years ago
I debug this more and found reason.

Problem seems to be in validation3.js -file.

It call refreshControlAndMessage() -function two times on every submit. In the 
first time isValid=true and second time it is false. 

If I change line 910:
this.isValid ? setTimeout(function() { msg.hide(); }, 250) : msg.show();
-->
this.isValid ? msg.hide(); : msg.show();

It work, but I am not sure is this right solution? Why it is called two times? 
And why msg.hide is called by timeout?

Original comment by sampsa.s...@inoob.com on 27 Jul 2012 at 10:58

GoogleCodeExporter commented 8 years ago
Your proposed patch seems to fix the issue without breaking any of the existing 
tests. By now it has been committed as r3195, but the issue probably needs to 
be further investigated

Original comment by ctrlal...@gmail.com on 30 Jul 2012 at 10:14

GoogleCodeExporter commented 8 years ago

Original comment by ctrlal...@gmail.com on 6 Aug 2012 at 4:24