From cc53959ac5ba3e786f3d6ad3403919b82c52fa42 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 6 Mar 2016 19:39:56 +0100 Subject: Activecontrols: avoid updating client side if the value didn't change Fix #399 --- framework/Web/UI/ActiveControls/TActiveCustomValidator.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/ActiveControls/TActiveCustomValidator.php') diff --git a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php index 18f9f5f3..fa7f8085 100644 --- a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php +++ b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php @@ -104,6 +104,9 @@ class TActiveCustomValidator extends TCustomValidator */ public function setIsValid($value) { + // Always update the clientside, since the clientside's value for IsValid + // it could have been changed by the clientside validation. + parent::setIsValid($value); if($this->getActiveControl()->canUpdateClientSide()) { @@ -137,11 +140,15 @@ class TActiveCustomValidator extends TCustomValidator } /** - * Sets the text for the error message. Updates client-side erorr message. + * Sets the text for the error message. Updates client-side error message. * @param string the error message */ public function setErrorMessage($value) { + if(parent::getErrorMessage() === $value) + return; + + parent::setErrorMessage($value); if($this->getActiveControl()->canUpdateClientSide()) { -- cgit v1.2.3