of_RefreshItem


pfcmain.pbl   >   pfc_u_tv   >   of_RefreshItem   

Full name pfc_u_tv.of_RefreshItem
Access public
Extend of integer
Return value integer
Prototype public function integer of_RefreshItem(long)

Name Datatype
No Data

Name Datatype
li_Index Integer
li_Limit Integer
ll_Row Long
ltvi_Item TreeViewItem

public function integer of_RefreshItem (long al_handle);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_RefreshItem
//
//	Access:  public
//
//	Arguments:
//	al_Handle						The handle of the item to be refreshed.
//
//	Returns:		Integer
//					1	- the item was refreshed successfully
//					-1	- an error occurred
//
//	Description:	Refresh an item in the TreeView.  This includes removing
//						all its children (and discarding their rows from the DataStores)
//						and resetting its Label and Data attributes from the DataStore.
//
//						NOTE:  If the value of any of the key columns in the DataStore
//						have changed, this function will not work.  It will no longer be
//						able to find the proper row.  In that case, get the row with
//						of_GetDataRow BEFORE it is changed and call 
//						of_RefreshItem(al_Handle, ai_Row)
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1999 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

Integer				li_Index, li_Limit
Long					ll_Row
TreeViewItem		ltvi_Item

If GetItem(al_Handle, ltvi_Item) = -1 Then Return -1

// Determine proper element in the data source attribute class
li_Limit = UpperBound(inv_ds)
If ltvi_Item.Level > li_Limit Then
	li_Index = li_Limit
Else
	li_Index = ltvi_Item.Level
End If

// Get the row in the DataStore for this item
ll_Row = inv_ds[li_Index].ds_obj.Find("pfc_tvi_key = '" + String(ltvi_Item.Data) + "'", &
																1, inv_ds[li_Index].ds_obj.RowCount())
If ll_Row < 1 Then Return -1

Return of_RefreshItem(al_Handle, ll_Row)

end function

     
Name Owner
pfc_u_tv.of_refreshlevel pfc_u_tv

     
Name Owner
treeview.getitem treeview
datastore.find datastore
datastore.rowcount datastore
systemfunctions.string systemfunctions
systemfunctions.upperbound systemfunctions
pfc_u_tv.of_refreshitem pfc_u_tv

     
Full name
No Data

     
Name Scope
No Data