From c0d9d27f16bae2e428225302da144e9cc6d4adc8 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 21 Jul 2006 16:14:01 +0000 Subject: merge from 3.0 branch till 1281. --- framework/Web/UI/WebControls/TDataList.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'framework/Web/UI/WebControls/TDataList.php') diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php index 2c562d6d..42c47f86 100644 --- a/framework/Web/UI/WebControls/TDataList.php +++ b/framework/Web/UI/WebControls/TDataList.php @@ -85,12 +85,26 @@ Prado::using('System.Web.UI.WebControls.TRepeatInfo'); * event will be raised. Note, the selected index may not be actually changed. * The event mainly informs the server side that the end-user has made a selection. * + * Each datalist item has a {@link TDataListItem::getItemType type} + * which tells the position and state of the item in the datalist. An item in the header + * of the repeater is of type 'Header'. A body item may be of either + * 'Item', 'AlternatingItem', 'SelectedItem' or 'EditItem', depending whether the item + * index is odd or even, whether it is being selected or edited. + * * TDataList raises an {@link onItemCommand OnItemCommand} whenever a button control * within some TDataList item raises a OnCommand event. If the command name * is one of the followings: 'edit', 'update', 'select', 'delete', 'cancel' (case-insensitive), * another event will also be raised. For example, if the command name is 'edit', * then the new event is {@link onEditCommand OnEditCommand}. * + * Note, the data bound to the datalist are reset to null after databinding. + * There are several ways to access the data associated with a datalist item: + * - Access the data in {@link onItemDataBound OnItemDataBound} event + * - Use {@link getDataKeys DataKeys} to obtain the data key associated with + * the specified datalist 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