summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorxue <>2006-03-30 16:59:18 +0000
committerxue <>2006-03-30 16:59:18 +0000
commit152f44e871998d6715a9b7d39e8d2bc30530aaf1 (patch)
tree9d09d3dc71f38390511962716886d690c5bf31c4 /framework/Web
parent61e3a9ef1e3082a97e2215b31011a52f6edaa45d (diff)
Fixed #106.
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/WebControls/THiddenField.php12
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php7
2 files changed, 15 insertions, 4 deletions
diff --git a/framework/Web/UI/WebControls/THiddenField.php b/framework/Web/UI/WebControls/THiddenField.php
index b920d1ad..54ecde08 100644
--- a/framework/Web/UI/WebControls/THiddenField.php
+++ b/framework/Web/UI/WebControls/THiddenField.php
@@ -23,7 +23,7 @@
* @package System.Web.UI.WebControls
* @since 3.0
*/
-class THiddenField extends TControl implements IPostBackDataHandler
+class THiddenField extends TControl implements IPostBackDataHandler, IValidatable
{
/**
* @return string tag name of the hidden field.
@@ -83,6 +83,16 @@ class THiddenField extends TControl implements IPostBackDataHandler
}
/**
+ * Returns the value to be validated.
+ * This methid is required by IValidatable interface.
+ * @return mixed the value of the property to be validated.
+ */
+ public function getValidationPropertyValue()
+ {
+ return $this->getValue();
+ }
+
+ /**
* Raises postdata changed event.
* This method calls {@link onValueChanged} method.
* This method is primarly used by framework developers.
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php
index bc490cdc..feea6227 100644
--- a/framework/Web/UI/WebControls/TTextBox.php
+++ b/framework/Web/UI/WebControls/TTextBox.php
@@ -139,13 +139,14 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
}
if($this->getReadOnly())
$writer->addAttribute('readonly','readonly');
- if(!$this->getEnabled(true) && $this->getEnabled()) // in this case parent will not render 'disabled'
+ $isEnabled=$this->getEnabled(true);
+ if(!$isEnabled && $this->getEnabled()) // in this case parent will not render 'disabled'
$writer->addAttribute('disabled','disabled');
- if($this->getEnabled(true) && $this->getAutoPostBack() && $page->getClientSupportsJavaScript())
+ if($isEnabled && $this->getAutoPostBack() && $page->getClientSupportsJavaScript())
{
$writer->addAttribute('id',$this->getClientID());
$this->getPage()->getClientScript()->registerPostBackControl('Prado.WebUI.TTextBox',$this->getPostBackOptions());
- }
+ }
parent::addAttributesToRender($writer);
}