diff options
Diffstat (limited to 'framework/Web/UI/WebControls/TDropDownList.php')
-rw-r--r-- | framework/Web/UI/WebControls/TDropDownList.php | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/framework/Web/UI/WebControls/TDropDownList.php b/framework/Web/UI/WebControls/TDropDownList.php index abd1bca5..f66daaf7 100644 --- a/framework/Web/UI/WebControls/TDropDownList.php +++ b/framework/Web/UI/WebControls/TDropDownList.php @@ -4,7 +4,7 @@ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2011 PradoSoft + * @copyright Copyright © 2005-2011 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -32,6 +32,12 @@ Prado::using('System.Web.UI.WebControls.TListControl'); * 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.
*
+ * When a prompt item is set, its index in the list is set to -1. So, the {@link getSelectedIndex SelectedIndex}
+ * property is not affected by a prompt item: the items list will still be zero-based.
+ *
+ * The {@link clearSelection clearSelection} method will select the prompt item if existing, otherway the first
+ * available item in the dropdown list will be selected.
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id$
* @package System.Web.UI.WebControls
@@ -40,7 +46,7 @@ Prado::using('System.Web.UI.WebControls.TListControl'); class TDropDownList extends TListControl implements IPostBackDataHandler, IValidatable
{
private $_dataChanged=false;
- private $_isValid=true; + private $_isValid=true;
/**
* Adds attributes to renderer.
@@ -128,21 +134,21 @@ class TDropDownList extends TListControl implements IPostBackDataHandler, IValid {
return $this->getSelectedValue();
}
- - /** - * Returns true if this control validated successfully. - * Defaults to true. - * @return bool wether this control validated successfully. - */ - public function getIsValid() - { - return $this->_isValid; - } - /** - * @param bool wether this control is valid. - */ - public function setIsValid($value) - { - $this->_isValid=TPropertyValue::ensureBoolean($value); - } +
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
}
|