summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorxue <>2007-03-31 13:19:58 +0000
committerxue <>2007-03-31 13:19:58 +0000
commit767bbb6d3db3b3068b8772b953cf9f040750dece (patch)
tree7f28ae19cbd49b542115a59b79fe96adc46cfafc /framework/Web
parentfeb92283147d1fa30056197639e011d4e672acec (diff)
Fixed #569.
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php
index 047a3084..3517c73a 100644
--- a/framework/Web/UI/WebControls/TTextBox.php
+++ b/framework/Web/UI/WebControls/TTextBox.php
@@ -142,6 +142,8 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
}
else
{
+ if($this->getPersistPassword() && ($text=$this->getText())!=='')
+ $writer->addAttribute('value',$text);
$writer->addAttribute('type','password');
}
if(($cols=$this->getColumns())>0)
@@ -406,6 +408,22 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
}
/**
+ * @return boolean whether password should be displayed in the textbox during postback. Defaults to false. This property only applies when TextMode='Password'.
+ */
+ public function getPersistPassword()
+ {
+ return $this->getViewState('PersistPassword',false);
+ }
+
+ /**
+ * @param boolean whether password should be displayed in the textbox during postback. This property only applies when TextMode='Password'.
+ */
+ public function setPersistPassword($value)
+ {
+ $this->setViewState('PersistPassword',TPropertyValue::ensureBoolean($value),false);
+ }
+
+ /**
* @return string the text content of the TTextBox control.
*/
public function getText()