summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY4
-rw-r--r--framework/Web/UI/WebControls/TDataBoundControl.php15
-rw-r--r--framework/Web/UI/WebControls/TListControl.php28
3 files changed, 35 insertions, 12 deletions
diff --git a/HISTORY b/HISTORY
index f9b67180..e1ddbfec 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,5 +1,5 @@
-Version 3.1.0 beta to be released
-=================================
+Version 3.1.0 beta April 9, 2007
+================================
BUG: Ticket#278 - client-side validator enable/disable (conditional) (Wei)
BUG: Ticket#492 - TDataGridPagerStyle not found error (Qiang)
BUG: Ticket#500 - URL encode in callback (Wei)
diff --git a/framework/Web/UI/WebControls/TDataBoundControl.php b/framework/Web/UI/WebControls/TDataBoundControl.php
index b043060d..653a4e44 100644
--- a/framework/Web/UI/WebControls/TDataBoundControl.php
+++ b/framework/Web/UI/WebControls/TDataBoundControl.php
@@ -328,7 +328,12 @@ abstract class TDataBoundControl extends TWebControl
$this->setRequiresDataBinding(false);
$this->dataBindProperties();
$this->onDataBinding(null);
- $data=$this->getData();
+
+ if(($view=$this->getDataSourceView())!==null)
+ $data=$view->select($this->getSelectParameters());
+ else
+ $data=null;
+
if($data instanceof Traversable)
{
if($this->getAllowPaging())
@@ -359,14 +364,6 @@ abstract class TDataBoundControl extends TWebControl
$this->setRequiresDataBinding(true);
}
- protected function getData()
- {
- if(($view=$this->getDataSourceView())!==null)
- return $view->select($this->getSelectParameters());
- else
- return null;
- }
-
protected function getDataSourceView()
{
if(!$this->_currentViewValid)
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()