summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TDataList.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TDataList.php')
-rw-r--r--framework/Web/UI/WebControls/TDataList.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index c0d74974..47b60cd6 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -1354,15 +1354,18 @@ class TDataListItem extends TWebControl implements INamingContainer
class TDataListItemCollection extends TList
{
/**
- * Returns true only when the item to be added is a {@link TDataListItem}.
- * This method is invoked before adding an item to the list.
- * If it returns true, the item will be added to the list, otherwise not.
- * @param mixed item to be added
- * @return boolean whether the item can be added to the list
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by inserting only TDataListItem.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a TDataListItem.
*/
- protected function canAddItem($item)
+ public function insertAt($index,$item)
{
- return ($item instanceof TDataListItem);
+ if($item instanceof TDataListItem)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('datalistitemcollection_datalistitem_required');
}
}