summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page18
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php18
3 files changed, 36 insertions, 1 deletions
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):
<h2>Password Text Boxes</h2>
-Password: <com:TTextBox TextMode="Password" />
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Password with default setting
+</td>
+<td class="sampleaction">
+<com:TTextBox TextMode="Password" /> <com:TButton ID="PassButton1" Text="submit" />
+</td></tr>
+
+<tr><td class="samplenote">
+Password with PersistPasswor set true
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="Password2" TextMode="Password" PersistPassword="true" />
+<com:TButton ID="PassButton2" Text="submit" />
+</td></tr>
+</table>
<h2>MultiLine Text Boxes</h2>
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()