summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--UPGRADE1
-rw-r--r--framework/Web/UI/WebControls/TDataList.php27
3 files changed, 24 insertions, 6 deletions
diff --git a/HISTORY b/HISTORY
index 1ffcfb31..fe8ec687 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,6 @@
Version 3.1.0 RC To be released
===============================
-CHG: removed <span> tags when TDataList.RepeatLayout is Raw (Qiang)
+CHG: <div> tags are used instead of <span> when TDataList.RepeatLayout is Raw (Qiang)
CHG: changed comment tag to <!--- ... ---> (Qiang)
Version 3.1.0 beta April 9, 2007
diff --git a/UPGRADE b/UPGRADE
index 51499d39..6e12c56f 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -16,6 +16,7 @@ Upgrading from v3.1b
you may use 'Flow' layout and set RepeatColumns as 1.
- Comment tag <!-- ... ---> (introduced in v3.1a) is changed to <!--- ... --->
+- When TDataList.RepeatLayout is Raw, the items will render <div> instead of <span>
Upgrading from v3.1a
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index 6cd01008..5c8ec700 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -1096,11 +1096,9 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs
public function renderItem($writer,$repeatInfo,$itemType,$index)
{
$item=$this->getItem($itemType,$index);
- $layout=$repeatInfo->getRepeatLayout();
- if($layout===TRepeatLayout::Raw)
- $item->renderContents($writer);
- else
- $item->renderControl($writer);
+ if($repeatInfo->getRepeatLayout()===TRepeatLayout::Raw && get_class($item)==='TDataListItem')
+ $item->setTagName('div');
+ $item->renderControl($writer);
}
/**
@@ -1611,6 +1609,25 @@ class TDataListItem extends TWebControl implements INamingContainer, IItemDataRe
*/
private $_data;
+ private $_tagName='span';
+
+ /**
+ * Returns the tag name used for this control.
+ * @return string tag name of the control to be rendered
+ */
+ protected function getTagName()
+ {
+ return $this->_tagName;
+ }
+
+ /**
+ * @param string tag name of the control to be rendered
+ */
+ public function setTagName($value)
+ {
+ $this->_tagName=$value;
+ }
+
/**
* Creates a style object for the control.
* This method creates a {@link TTableItemStyle} to be used by a datalist item.