From 4f968c045e0d09ab3e4f659743effb5305a963ce Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 30 Mar 2007 05:04:30 +0000 Subject: Fixed #507 and update other active controls. --- framework/Web/UI/WebControls/TBaseValidator.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'framework/Web/UI/WebControls/TBaseValidator.php') diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index 99a81375..a755d605 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -172,8 +172,7 @@ abstract class TBaseValidator extends TLabel implements IValidator if($control instanceof TDatePicker) $options['DateFormat'] = $control->getDateFormat(); - if(!is_null($this->_clientSide)) - $options = array_merge($options,$this->_clientSide->getOptions()->toArray()); + $options = array_merge($options,$this->getClientSide()->getOptions()->toArray()); return $options; } @@ -242,7 +241,7 @@ abstract class TBaseValidator extends TLabel implements IValidator $scripts->registerPradoScript('validator'); $scripts->registerEndScript($scriptKey, "new Prado.ValidationManager({$options});"); } - if($this->getEnableClientScript()) + if($this->getEnableClientScript() & $this->getEnabled(true)) $this->registerClientScriptValidator(); $this->updateControlCssClass(); } @@ -272,9 +271,9 @@ abstract class TBaseValidator extends TLabel implements IValidator */ protected function registerClientScriptValidator() { - if($this->getEnabled(true)) + $key = 'prado:'.$this->getClientID(); + if(!$this->getPage()->getClientScript()->isEndScriptRegistered($key)) { - $key = 'prado:'.$this->getClientID(); $options = TJavaScript::encode($this->getClientScriptOptions()); $script = 'new '.$this->getClientClassName().'('.$options.');'; $this->getPage()->getClientScript()->registerEndScript($key, $script); -- cgit v1.2.3