summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TBaseValidator.php
diff options
context:
space:
mode:
authorwei <>2007-03-30 05:04:30 +0000
committerwei <>2007-03-30 05:04:30 +0000
commit4f968c045e0d09ab3e4f659743effb5305a963ce (patch)
tree58d5cb87db43ba87c0a559d411e9d36aa0bd7f3c /framework/Web/UI/WebControls/TBaseValidator.php
parent70744a98444df0583d76f19d4e399a5cc49349b7 (diff)
Fixed #507 and update other active controls.
Diffstat (limited to 'framework/Web/UI/WebControls/TBaseValidator.php')
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php9
1 files changed, 4 insertions, 5 deletions
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);