pfc_endlabeledit


pfcapsrv.pbl   >   pfc_n_cst_lvsrv_datasource   >   pfc_endlabeledit   

Full name pfc_n_cst_lvsrv_datasource.pfc_endlabeledit
Access public
Extend of long
Return value long
Prototype event long pfc_endlabeledit(integer,string)

Name Datatype
No Data

Name Datatype
lds_DataStore n_ds
ll_Row long
llvi_Item listviewitem

event pfc_EndLabelEdit;//////////////////////////////////////////////////////////////////////////////
//	Event:			pfc_EndLabelEdit
//	Arguments:		ai_index			Index of the listview item being used
//						as_newlabel		Text to become the new label of the listview item
//	Returns:			Long
//						CONTINUE_ACTION	Allow the new text to become the item's label
//						PREVENT_ACTION		Prevent the new text from becoming the item's label
//	Description:	Change the label column in the appropriate data source to be
//						the newtext.  This only works if the label column is updatable.
//						If a computed column is being used for the label, override
//						this script with appropriate code.
//						NOTE:  Update() is NOT called for the DataStore.  This is
//						left to the user to perform.
//////////////////////////////////////////////////////////////////////////////
//	Rev. History:	Version
//						6.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.
//////////////////////////////////////////////////////////////////////////////
long					ll_Row
n_ds					lds_DataStore
listviewitem		llvi_Item

// Check reference variables
if IsNull(ilv_requestor) or not IsValid(ilv_requestor) then return -1

// Make sure the label did change
ilv_requestor.GetItem(ai_index, llvi_Item)
if as_newlabel = llvi_Item.Label then return PREVENT_ACTION

// Get the row in the DataStore
if this.of_GetDataRow(ai_index, lds_DataStore, ll_Row) = FAILURE then return PREVENT_ACTION

// Change the value of the label column
if lds_DataStore.SetItem(ll_Row, inv_Attrib.is_LabelColumn, as_newlabel) < 1 then return PREVENT_ACTION

// Set the undo values
if ib_Undo then
	il_UndoEditHandle = ai_index
	is_UndoEditLabelText = llvi_Item.Label
	is_UndoType = UNDO_EDIT
end if

return CONTINUE_ACTION
end event

     
Name Owner
pfc_u_lvs.endlabeledit pfc_u_lvs

     
Name Owner
listview.getitem listview
datastore.setitem datastore
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
pfc_n_cst_lvsrv_datasource.of_GetDataRow pfc_n_cst_lvsrv_datasource

     
Full name
No Data

     
Name Scope
No Data