summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorxue <>2006-09-03 12:27:38 +0000
committerxue <>2006-09-03 12:27:38 +0000
commita55994488789e9c481aab5e3e49b15bd9718afc1 (patch)
tree23193e56be6440c13e646ed5a859290dad45ab59 /framework/Web
parent4cf72b151eba3357da19d670c8cccd49851a5fbe (diff)
Fixed #357.
Diffstat (limited to 'framework/Web')
-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 1c65259c..856205b2 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -186,6 +186,7 @@ abstract class TListControl extends TDataBoundControl
if($valueField==='')
$valueField=1;
$textFormat=$this->getDataTextFormatString();
+ $groupField=$this->getDataGroupField();
foreach($data as $key=>$object)
{
$item=$items->createListItem();
@@ -194,6 +195,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
{
@@ -387,6 +390,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()