From 767bbb6d3db3b3068b8772b953cf9f040750dece Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 31 Mar 2007 13:19:58 +0000 Subject: Fixed #569. --- framework/Web/UI/WebControls/TTextBox.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'framework/Web/UI') 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) @@ -405,6 +407,22 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable $this->setViewState('Rows',TPropertyValue::ensureInteger($value),self::DEFAULT_ROWS); } + /** + * @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. */ -- cgit v1.2.3