summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TListControl.php
diff options
context:
space:
mode:
authorxue <>2006-09-04 19:15:47 +0000
committerxue <>2006-09-04 19:15:47 +0000
commit56fee292c37e162c03fab9eeadd6a8b9ab85c251 (patch)
tree923510b93c707868098ae4e5f404eb3766a59553 /framework/Web/UI/WebControls/TListControl.php
parentb107cad91733d4a2a80f42cdbaab41a4f7b41c9d (diff)
merge from 3.0 branch till 1387
Diffstat (limited to 'framework/Web/UI/WebControls/TListControl.php')
-rw-r--r--framework/Web/UI/WebControls/TListControl.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php
index 76c59903..3a0a4f76 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -195,6 +195,7 @@ abstract class TListControl extends TDataBoundControl
if($valueField==='')
$valueField=1;
$textFormat=$this->getDataTextFormatString();
+ $groupField=$this->getDataGroupField();
foreach($data as $key=>$object)
{
$item=$items->createListItem();
@@ -203,6 +204,8 @@ abstract class TListControl extends TDataBoundControl
$text=TDataFieldAccessor::getDataFieldValue($object,$textField);
$value=TDataFieldAccessor::getDataFieldValue($object,$valueField);
$item->setValue($value);
+ if($groupField!=='')
+ $item->setAttribute('Group',TDataFieldAccessor::getDataFieldValue($object,$groupField));
}
else
{
@@ -396,6 +399,22 @@ abstract class TListControl extends TDataBoundControl
}
/**
+ * @return string the field of the data source that provides the label of the list item groups
+ */
+ public function getDataGroupField()
+ {
+ return $this->getViewState('DataGroupField','');
+ }
+
+ /**
+ * @param string the field of the data source that provides the label of the list item groups
+ */
+ public function setDataGroupField($value)
+ {
+ $this->setViewState('DataGroupField',$value,'');
+ }
+
+ /**
* @return integer the number of items in the list control
*/
public function getItemCount()