From 17f5a7e22cd511abbddf7111fc8bab751d3dc7e6 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 18 Jul 2006 12:46:30 +0000 Subject: Documentation update. --- framework/Web/UI/WebControls/TRepeater.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI/WebControls/TRepeater.php') diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php index eb599341..01c88a30 100644 --- a/framework/Web/UI/WebControls/TRepeater.php +++ b/framework/Web/UI/WebControls/TRepeater.php @@ -36,6 +36,12 @@ Prado::using('System.Util.TDataFieldAccessor'); * {@link setSeparatorTemplate SeparatorTemplate}, if not empty, will be * displayed between items. * + * Each repeater item has a {@link TRepeaterItem::getItemType type} + * which tells the position of the item in the repeater. An item in the header + * of the repeater is of type TRepeater::IT_HEADER. A body item may be of either + * TRepeater::IT_ITEM or TRepeater::IT_ALTERNATINGITEM, depending whether the item + * index is odd or even. + * * You can retrive the repeated contents by the {@link getItems Items} property. * The header and footer items can be accessed by {@link getHeader Header} * and {@link getFooter Footer} properties, respectively. @@ -46,10 +52,18 @@ Prado::using('System.Util.TDataFieldAccessor'); * databinding, an {@link onItemDataBound OnItemDataBound} event will be raised. * * TRepeater raises an {@link onItemCommand OnItemCommand} whenever a button control - * within some repeater item raises a Command event. Therefore, - * you can handle all sorts of Command event in a central place by + * within some repeater item raises a OnCommand event. Therefore, + * you can handle all sorts of OnCommand event in a central place by * writing an event handler for {@link onItemCommand OnItemCommand}. * + * Note, the data bound to the repeater are reset to null after databinding. + * There are several ways to access the data associated with a repeater item: + * - Access the data in {@link onItemDataBound OnItemDataBound} event + * - Use {@link getDataKeys DataKeys} to obtain the data key associated with + * the specified repeater item and use the key to fetch the corresponding data + * from some persistent storage such as DB. + * - Save the data in viewstate and get it back during postbacks. + * * @author Qiang Xue * @version $Revision: $ $Date: $ * @package System.Web.UI.WebControls -- cgit v1.2.3