summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TBaseValidator.php
diff options
context:
space:
mode:
authorwei <>2006-01-09 04:39:05 +0000
committerwei <>2006-01-09 04:39:05 +0000
commit9f2ecd591d5be41bb9dc7b8a0fa144ac35a173bb (patch)
tree122d77d166d5df687d524173b883d87fd6674c0d /framework/Web/UI/WebControls/TBaseValidator.php
parent9c9a2d731fea9679f65904a3a6b72dd78b4253a4 (diff)
TRequiredFieldValidator works now. See FunctionalTests/index.php in your browser.
Diffstat (limited to 'framework/Web/UI/WebControls/TBaseValidator.php')
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php25
1 files changed, 14 insertions, 11 deletions
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index f8bfc28b..fb6cca06 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -127,13 +127,13 @@ abstract class TBaseValidator extends TLabel implements IValidator
*/
protected function getClientScriptOptions()
{
- $options['ID'] = $this->getClientID();
- $options['Display'] = $this->getDisplay();
- $options['ErrorMessage'] = $this->getErrorMessage();
- $options['FocusOnError'] = $this->getFocusOnError();
- $options['FocusElementID'] = $this->getFocusElementID();
- $options['ValidationGroup'] = $this->getValidationGroup();
- $options['ControlToValidate'] = $this->getValidationTarget()->getClientID();
+ $options['id'] = $this->getClientID();
+ $options['display'] = $this->getDisplay();
+ $options['errormessage'] = $this->getErrorMessage();
+ $options['focusonerror'] = $this->getFocusOnError();
+ $options['focuselementid'] = $this->getFocusElementID();
+ $options['validationgroup'] = $this->getValidationGroup();
+ $options['controltovalidate'] = $this->getValidationTarget()->getClientID();
return $options;
}
@@ -146,7 +146,7 @@ abstract class TBaseValidator extends TLabel implements IValidator
protected function onPreRender($param)
{
$scripts = $this->getPage()->getClientScript();
- $scriptKey = "prado:".get_class($this);
+ $scriptKey = "TBaseValidator";
if($this->getEnableClientScript() && !$scripts->isEndScriptRegistered($scriptKey))
{
$scripts->registerPradoScript('validator');
@@ -234,7 +234,8 @@ abstract class TBaseValidator extends TLabel implements IValidator
*/
public function getErrorMessage()
{
- return $this->getViewState('ErrorMessage','');
+ return $this->getText();
+ //return $this->getViewState('ErrorMessage','');
}
/**
@@ -243,7 +244,8 @@ abstract class TBaseValidator extends TLabel implements IValidator
*/
public function setErrorMessage($value)
{
- $this->setViewState('ErrorMessage',$value,'');
+ $this->setText($value);
+ //$this->setViewState('ErrorMessage',$value,'');
}
/**
@@ -364,7 +366,8 @@ abstract class TBaseValidator extends TLabel implements IValidator
$this->setIsValid(true);
$control=$this->getValidationTarget();
if($control && $this->getVisible(true) && $this->getEnabled())
- $valid=$this->evaluateIsValid();
+ $this->setIsValid($this->evaluateIsValid());
+ return $this->getIsValid();
}
/**