summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TListControl.php
diff options
context:
space:
mode:
authorxue <>2007-04-09 02:44:50 +0000
committerxue <>2007-04-09 02:44:50 +0000
commitd43420201b1ed45574886e4a94f3f904bd4ea517 (patch)
treeb2f86958f6f5257a36e071b5ae7ea6cb73f1c0ba /framework/Web/UI/WebControls/TListControl.php
parentff32eed01f783ee33caeacb0f7315612f0994f8f (diff)
Implemented IDataRenderer for TListControl.
Diffstat (limited to 'framework/Web/UI/WebControls/TListControl.php')
-rw-r--r--framework/Web/UI/WebControls/TListControl.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php
index d726d1a2..bb51934c 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -78,7 +78,7 @@ Prado::using('System.Util.TDataFieldAccessor');
* @package System.Web.UI.WebControls
* @since 3.0
*/
-abstract class TListControl extends TDataBoundControl
+abstract class TListControl extends TDataBoundControl implements IDataRenderer
{
/**
* @var TListItemCollection item list
@@ -549,6 +549,32 @@ abstract class TListControl extends TDataBoundControl
}
/**
+ * Returns the value of the selected item with the lowest cardinal index.
+ * This method is required by {@link IDataRenderer}.
+ * It is the same as {@link getSelectedValue()}.
+ * @return string the value of the selected item with the lowest cardinal index, empty if no selection.
+ * @see getSelectedValue
+ * @since 3.1.0
+ */
+ public function getData()
+ {
+ return $this->getSelectedValue();
+ }
+
+ /**
+ * Selects an item by the specified value.
+ * This method is required by {@link IDataRenderer}.
+ * It is the same as {@link setSelectedValue()}.
+ * @param string the value of the item to be selected.
+ * @see setSelectedValue
+ * @since 3.1.0
+ */
+ public function setData($value)
+ {
+ $this->setSelectedValue($value);
+ }
+
+ /**
* @return string the value of the selected item with the lowest cardinal index, empty if no selection
*/
public function getSelectedValue()