diff options
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 3 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/THtmlArea.php | 18 |
2 files changed, 16 insertions, 5 deletions
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index c9917a2b..c90f4d9d 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -239,7 +239,6 @@ abstract class TBaseValidator extends TLabel implements IValidator {
$manager['FormID'] = $formID;
$options = TJavaScript::encode($manager);
- $scripts->registerPradoScript('validator');
$scripts->registerEndScript($scriptKey, "new Prado.ValidationManager({$options});");
}
if($this->getEnableClientScript())
@@ -254,6 +253,8 @@ abstract class TBaseValidator extends TLabel implements IValidator {
parent::onPreRender($param);
$this->updateControlCssClass();
+ if ($this->getEnableClientScript())
+ $this->getPage()->getClientScript()->registerPradoScript('validator');
}
/**
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php index 0af7a979..b11778bd 100644 --- a/framework/Web/UI/WebControls/THtmlArea.php +++ b/framework/Web/UI/WebControls/THtmlArea.php @@ -341,6 +341,20 @@ class THtmlArea extends TTextBox }
/**
+ * Registers clientscripts
+ *
+ * This method overrides the parent implementation and is invoked before render.
+ * @param mixed event parameter
+ */
+ public function onPreRender($param)
+ {
+ parent::onPreRender($param);
+ $this->loadJavascriptLibrary();
+ if($this->getEnableCompression())
+ $this->preLoadCompressedScript();
+ }
+
+ /**
* Adds attribute name-value pairs to renderer.
* This method overrides the parent implementation by registering
* additional javacript code.
@@ -354,10 +368,6 @@ class THtmlArea extends TTextBox $this->registerEditorClientScript($writer);
}
- $this->loadJavascriptLibrary();
- if($this->getEnableCompression())
- $this->preLoadCompressedScript();
-
parent::addAttributesToRender($writer);
}
|