summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TValidationSummary.php
diff options
context:
space:
mode:
authorwei <>2006-02-18 23:41:16 +0000
committerwei <>2006-02-18 23:41:16 +0000
commit270282e3a26b21184a2051995cb5b9a2755b823d (patch)
tree761d82ad761996f329d63acc770fc5a0bce9d5a2 /framework/Web/UI/WebControls/TValidationSummary.php
parentf1cc3c880b564362e7f00b18326e116884879231 (diff)
Update some javascript code.
Diffstat (limited to 'framework/Web/UI/WebControls/TValidationSummary.php')
-rw-r--r--framework/Web/UI/WebControls/TValidationSummary.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php
index e7115c99..61a4415c 100644
--- a/framework/Web/UI/WebControls/TValidationSummary.php
+++ b/framework/Web/UI/WebControls/TValidationSummary.php
@@ -37,6 +37,25 @@
class TValidationSummary extends TWebControl
{
/**
+ * @return string the display behavior (None, Static, Dynamic) of the error message in a validation summary component.
+ */
+ public function getDisplay()
+ {
+ return $this->getViewState('Display','Static');
+ }
+
+ /**
+ * Sets the display behavior (None, Static, Dynamic) of the error message in a validation summary component.
+ * @param string the display behavior (None, Static, Dynamic)
+ */
+ public function setDisplay($value)
+ {
+ if($value!='None' && $value!='Dynamic')
+ $value='Static';
+ $this->setViewState('Display',$value,'Static');
+ }
+
+ /**
* @return string the header text displayed at the top of the summary
*/
public function getHeaderText()
@@ -170,6 +189,15 @@ class TValidationSummary extends TWebControl
protected function addAttributesToRender($writer)
{
+ $display=$this->getDisplay();
+ $visible=$this->getEnabled(true) && count($this->getErrorMessages()) > 0;
+ if(!$visible)
+ {
+ if($display==='None' || $display==='Dynamic')
+ $writer->addStyleAttribute('display','none');
+ else
+ $writer->addStyleAttribute('visibility','hidden');
+ }
$writer->addAttribute('id',$this->getClientID());
parent::addAttributesToRender($writer);
}
@@ -205,6 +233,7 @@ class TValidationSummary extends TWebControl
$options['refresh'] = $this->getAutoUpdate();
$options['validationgroup'] = $this->getValidationGroup();
+ $options['display'] = $this->getDisplay();
return $options;
}