|
pfc_refreshitem
|
|
Full name
|
pfc_n_cst_tvsrv_levelsource.pfc_refreshitem
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
event integer pfc_refreshitem(long)
|
Name
|
Datatype
|
la_data
|
any
|
lds_Source
|
n_ds
|
li_rc
|
Integer
|
ll_Row
|
Long
|
ltvi_Item
|
treeviewItem
|
event pfc_refreshitem;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_RefreshItem
//
// Arguments:
// al_handle The handle of the item to be refreshed.
//
// Returns: Integer
// 1 if successfull
// -1 if an error occurred
//
// Description: Refresh an item in the treeview. Reset all its attributes to the
// default values based on the data in the DataStore.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 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.
//
//////////////////////////////////////////////////////////////////////////////
any la_data
Integer li_rc
Long ll_Row
treeviewItem ltvi_Item
n_ds lds_Source
// check reference variables
If IsNull(itv_requestor) or Not IsValid(itv_requestor) Then Return -1
If (al_handle < 0) or IsNull(al_handle) Then Return -1
// Get the item
If itv_requestor.GetItem(al_handle, ltvi_Item) <> 1 Then Return -1
// Collapse the item
If ltvi_Item.Expanded Then
itv_requestor.CollapseItem(al_Handle)
itv_requestor.GetItem(al_Handle, ltvi_Item)
End If
// Get the corresponding row in the DataStore
If this.of_GetDataRow(al_handle, lds_Source, ll_Row) <> 1 Then
Return -1
End If
// Discard its child items
If this.of_DiscardChildren(al_Handle) = -1 Then Return -1
// remember the data attribute - it is set only at insert item
la_data = ltvi_item.data
// Set the item's attributes
itv_requestor.event pfc_SetItemAttributes(al_handle, lds_source, ll_row, ltvi_item)
// Perform the Prerefreshitem logic if needed
itv_requestor.event pfc_prerefreshitem(al_handle, lds_source, ll_row, ltvi_item)
// replace the data attribute
ltvi_item.data = la_data
// Refresh the item
li_rc = itv_requestor.SetItem(al_handle, ltvi_Item)
Return li_rc
end event