diff options
author | xue <> | 2007-10-06 21:05:39 +0000 |
---|---|---|
committer | xue <> | 2007-10-06 21:05:39 +0000 |
commit | 5892bb8bb76f7e4addd14da5dd9c5a68b6c59db9 (patch) | |
tree | 36d9230dedb1365862faca8718ad6e0d86582b6f /framework/Web/UI/WebControls/TRepeaterItemRenderer.php | |
parent | b9b876ae5968ca65c4b3cd66f3e92ae4e69cab69 (diff) |
Added TDataRenderer and TItemDataRenderer
Diffstat (limited to 'framework/Web/UI/WebControls/TRepeaterItemRenderer.php')
-rw-r--r-- | framework/Web/UI/WebControls/TRepeaterItemRenderer.php | 82 |
1 files changed, 5 insertions, 77 deletions
diff --git a/framework/Web/UI/WebControls/TRepeaterItemRenderer.php b/framework/Web/UI/WebControls/TRepeaterItemRenderer.php index fa0b2aca..b37f685a 100644 --- a/framework/Web/UI/WebControls/TRepeaterItemRenderer.php +++ b/framework/Web/UI/WebControls/TRepeaterItemRenderer.php @@ -11,97 +11,25 @@ */
Prado::using('System.Web.UI.WebControls.TRepeater');
+Prado::using('System.Web.UI.WebControls.TItemDataRenderer');
/**
* TRepeaterItemRenderer class
*
* TRepeaterItemRenderer can be used as a convenient base class to
- * define an item renderer class for {@link TRepeater}.
+ * define an item renderer class specific for {@link TRepeater}.
*
- * Because TRepeaterItemRenderer extends from {@link TTemplateControl}, derived child classes
- * can have templates to define their presentational layout.
+ * TRepeaterItemRenderer extends {@link TItemDataRenderer} and implements
+ * the bubbling scheme for the OnCommand event of repeater items.
*
- * TRepeaterItemRenderer implements {@link IItemDataRenderer} interface,
- * which enables the following properties that are related with data-bound controls:
- * - {@link getItemIndex ItemIndex}: zero-based index of this control in the repeater item collection.
- * - {@link getItemType ItemType}: item type of this control, such as TListItemType::AlternatingItem
- * - {@link getData Data}: data associated with this control
-
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id$
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
-class TRepeaterItemRenderer extends TTemplateControl implements IItemDataRenderer
+class TRepeaterItemRenderer extends TItemDataRenderer
{
/**
- * index of the data item in the Items collection of repeater
- */
- private $_itemIndex;
- /**
- * type of the TRepeaterItem
- * @var TListItemType
- */
- private $_itemType;
- /**
- * data associated with this item
- * @var mixed
- */
- private $_data;
-
- /**
- * @return TListItemType item type
- */
- public function getItemType()
- {
- return $this->_itemType;
- }
-
- /**
- * @param TListItemType item type.
- */
- public function setItemType($value)
- {
- $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
- }
-
- /**
- * Returns a value indicating the zero-based index of the item in the corresponding data control's item collection.
- * If the item is not in the collection (e.g. it is a header item), it returns -1.
- * @return integer zero-based index of the item.
- */
- public function getItemIndex()
- {
- return $this->_itemIndex;
- }
-
- /**
- * Sets the zero-based index for the item.
- * If the item is not in the item collection (e.g. it is a header item), -1 should be used.
- * @param integer zero-based index of the item.
- */
- public function setItemIndex($value)
- {
- $this->_itemIndex=TPropertyValue::ensureInteger($value);
- }
-
- /**
- * @return mixed data associated with the item
- */
- public function getData()
- {
- return $this->_data;
- }
-
- /**
- * @param mixed data to be associated with the item
- */
- public function setData($value)
- {
- $this->_data=$value;
- }
-
- /**
* This method overrides parent's implementation by wrapping event parameter
* for <b>OnCommand</b> event with item information.
* @param TControl the sender of the event
|