Changeset 2303 for trunk/framework/Web/UI
- Timestamp:
- 10/06/2007 04:05:39 PM (15 months ago)
- Location:
- trunk/framework/Web/UI/WebControls
- Files:
-
- 2 added
- 2 modified
-
TDataListItemRenderer.php (modified) (3 diffs)
-
TDataRenderer.php (added)
-
TItemDataRenderer.php (added)
-
TRepeaterItemRenderer.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/framework/Web/UI/WebControls/TDataListItemRenderer.php
r1672 r2303 17 17 * 18 18 * TDataListItemRenderer can be used as a convenient base class to 19 * define an item renderer class for {@link TDataList}.19 * define an item renderer class specific for {@link TDataList}. 20 20 * 21 * Because TDataListItemRenderer extends from {@link TTemplateControl}, derived child classes22 * can have templates to define their presentational layout.21 * TDataListItemRenderer extends {@link TItemDataRenderer} and implements 22 * the bubbling scheme for the OnCommand event of data list items. 23 23 * 24 * TDataListItemRenderer implements {@link IItemDataRenderer} interface, 25 * which enables the following properties that are related with data-bound controls: 26 * - {@link getItemIndex ItemIndex}: zero-based index of this control in the datalist item collection. 27 * - {@link getItemType ItemType}: item type of this control, such as TListItemType::AlternatingItem 28 * - {@link getData Data}: data associated with this control 29 24 * TDataListItemRenderer also implements the {@link IStyleable} interface, 25 * which allows TDataList to apply CSS styles to the renders. 26 * 30 27 * @author Qiang Xue <qiang.xue@gmail.com> 31 28 * @version $Id$ … … 33 30 * @since 3.1.0 34 31 */ 35 class TDataListItemRenderer extends T TemplateControl implements IItemDataRenderer,IStyleable32 class TDataListItemRenderer extends TItemDataRenderer implements IStyleable 36 33 { 37 /**38 * index of the data item in the Items collection of TDataList39 * @var integer40 */41 private $_itemIndex;42 /**43 * type of the TDataListItem44 * @var TListItemType45 */46 private $_itemType;47 /**48 * value of the data associated with this item49 * @var mixed50 */51 private $_data;52 53 34 /** 54 35 * Creates a style object to be used by the control. … … 90 71 { 91 72 $this->clearViewState('Style'); 92 }93 94 /**95 * @return TListItemType item type96 */97 public function getItemType()98 {99 return $this->_itemType;100 }101 102 /**103 * @param TListItemType item type.104 */105 public function setItemType($value)106 {107 $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');108 }109 110 /**111 * @return integer zero-based index of the item in the item collection of datalist112 */113 public function getItemIndex()114 {115 return $this->_itemIndex;116 }117 118 /**119 * Sets the zero-based index for the item.120 * If the item is not in the item collection (e.g. it is a header item), -1 should be used.121 * @param integer zero-based index of the item.122 */123 public function setItemIndex($value)124 {125 $this->_itemIndex=TPropertyValue::ensureInteger($value);126 }127 128 /**129 * @return mixed data associated with the item130 */131 public function getData()132 {133 return $this->_data;134 }135 136 /**137 * @param mixed data to be associated with the item138 */139 public function setData($value)140 {141 $this->_data=$value;142 73 } 143 74 -
trunk/framework/Web/UI/WebControls/TRepeaterItemRenderer.php
r1672 r2303 12 12 13 13 Prado::using('System.Web.UI.WebControls.TRepeater'); 14 Prado::using('System.Web.UI.WebControls.TItemDataRenderer'); 14 15 15 16 /** … … 17 18 * 18 19 * TRepeaterItemRenderer can be used as a convenient base class to 19 * define an item renderer class for {@link TRepeater}.20 * define an item renderer class specific for {@link TRepeater}. 20 21 * 21 * Because TRepeaterItemRenderer extends from {@link TTemplateControl}, derived child classes22 * can have templates to define their presentational layout.22 * TRepeaterItemRenderer extends {@link TItemDataRenderer} and implements 23 * the bubbling scheme for the OnCommand event of repeater items. 23 24 * 24 * TRepeaterItemRenderer implements {@link IItemDataRenderer} interface,25 * which enables the following properties that are related with data-bound controls:26 * - {@link getItemIndex ItemIndex}: zero-based index of this control in the repeater item collection.27 * - {@link getItemType ItemType}: item type of this control, such as TListItemType::AlternatingItem28 * - {@link getData Data}: data associated with this control29 30 25 * @author Qiang Xue <qiang.xue@gmail.com> 31 26 * @version $Id$ … … 33 28 * @since 3.1.0 34 29 */ 35 class TRepeaterItemRenderer extends T TemplateControl implements IItemDataRenderer30 class TRepeaterItemRenderer extends TItemDataRenderer 36 31 { 37 /**38 * index of the data item in the Items collection of repeater39 */40 private $_itemIndex;41 /**42 * type of the TRepeaterItem43 * @var TListItemType44 */45 private $_itemType;46 /**47 * data associated with this item48 * @var mixed49 */50 private $_data;51 52 /**53 * @return TListItemType item type54 */55 public function getItemType()56 {57 return $this->_itemType;58 }59 60 /**61 * @param TListItemType item type.62 */63 public function setItemType($value)64 {65 $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');66 }67 68 /**69 * Returns a value indicating the zero-based index of the item in the corresponding data control's item collection.70 * If the item is not in the collection (e.g. it is a header item), it returns -1.71 * @return integer zero-based index of the item.72 */73 public function getItemIndex()74 {75 return $this->_itemIndex;76 }77 78 /**79 * Sets the zero-based index for the item.80 * If the item is not in the item collection (e.g. it is a header item), -1 should be used.81 * @param integer zero-based index of the item.82 */83 public function setItemIndex($value)84 {85 $this->_itemIndex=TPropertyValue::ensureInteger($value);86 }87 88 /**89 * @return mixed data associated with the item90 */91 public function getData()92 {93 return $this->_data;94 }95 96 /**97 * @param mixed data to be associated with the item98 */99 public function setData($value)100 {101 $this->_data=$value;102 }103 104 32 /** 105 33 * This method overrides parent's implementation by wrapping event parameter
