summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2007-09-28 02:01:43 +0000
committerxue <>2007-09-28 02:01:43 +0000
commit0d682e512ad1d07434320ace888c88511fb8426b (patch)
tree6ad3e897796c3aa5eb63b557f9eefeff67f3129a /framework
parent95cc364ff7afdf2b70c1332e6980141a9645b304 (diff)
Fix prompt selection behavior.
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/UI/WebControls/TDropDownList.php4
-rw-r--r--framework/Web/UI/WebControls/TListControl.php10
2 files changed, 6 insertions, 8 deletions
diff --git a/framework/Web/UI/WebControls/TDropDownList.php b/framework/Web/UI/WebControls/TDropDownList.php
index 883073c5..1710d316 100644
--- a/framework/Web/UI/WebControls/TDropDownList.php
+++ b/framework/Web/UI/WebControls/TDropDownList.php
@@ -29,8 +29,8 @@ Prado::using('System.Web.UI.WebControls.TListControl');
* </code>
*
* Since v3.1.1, TDropDownList starts to support prompt text. That is, a prompt item can be
- * displayed as the first list item by specifying {@link setPromptText PromptText}. Choosing
- * the prompt item will unselect the TDropDownList.
+ * displayed as the first list item by specifying either {@link setPromptText PromptText} or
+ * {@link setPromptValue PromptValue}, or both. Choosing the prompt item will unselect the TDropDownList.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id$
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php
index 6e478550..785bd194 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -704,7 +704,7 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer
}
/**
- * @return string the prompt text which is to be displayed as the first list item. Defaults to empty, meaning no prompt.
+ * @return string the prompt text which is to be displayed as the first list item.
* @since 3.1.1
*/
public function getPromptText()
@@ -713,7 +713,7 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer
}
/**
- * @param string the prompt text which is to be displayed as the first list item. If empty, {@link getPromptValue PromptValue} will be displayed.
+ * @param string the prompt text which is to be displayed as the first list item.
* @since 3.1.1
*/
public function setPromptText($value)
@@ -722,7 +722,7 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer
}
/**
- * @return string the prompt selection value. Defaults to empty, meaning no prompt.
+ * @return string the prompt selection value.
* @see getPromptText
* @since 3.1.1
*/
@@ -773,11 +773,9 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer
{
$text=$this->getPromptText();
$value=$this->getPromptValue();
- if($text==='')
- $text=$value;
if($value==='')
$value=$text;
- if($text!=='')
+ if($value!=='')
{
$writer->addAttribute('value',$value);
$writer->renderBeginTag('option');