From 767bbb6d3db3b3068b8772b953cf9f040750dece Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 31 Mar 2007 13:19:58 +0000 Subject: Fixed #569. --- HISTORY | 1 + .../pages/Controls/Samples/TTextBox/Home.page | 18 +++++++++++++++++- framework/Web/UI/WebControls/TTextBox.php | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index c5865343..30d9b0a6 100644 --- a/HISTORY +++ b/HISTORY @@ -26,6 +26,7 @@ ENH: Ticket#503 - Localization and parameter tags can now appear as a substring ENH: Ticket#513 - Display last modified / revision in quickstart (Wei) ENH: Ticket#519 - Update TActiveRecord implementation (Wei) ENH: Ticket#537 - TActiveRecord Pk info ENH [usage: http://trac.pradosoft.com/prado/ticket/537] (Wei) +ENH: Ticket#569 - Added TTextBox.PersistPassword property (Qiang) ENH: Added PRADO_CHMOD constant so that users can specify the permission of PRADO-created directories (Qiang) ENH: Added Display property to TWebControl (Wei) ENH: Added TUser.getState() and setState() for storing user session data (Qiang) diff --git a/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page index 0ba6dd3b..1c307779 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page @@ -96,7 +96,23 @@ Safety feature (cross-site scripting prevention):

Password Text Boxes

-Password: + + + + + + + +
+Password with default setting + + +
+Password with PersistPasswor set true + + + +

MultiLine Text Boxes

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