of_update


pfcmain.pbl   >   pfc_u_tvs   >   of_update   

Full name pfc_u_tvs.of_update
Access public
Extend of integer
Return value integer
Prototype public function integer of_update(boolean,boolean,powerobject)

Name Datatype
No Data

Name Datatype
li_rc integer
lpo_notvalid powerobject
lpo_pending powerobject[]
lpo_updatearray powerobject[]

public function integer of_update (boolean ab_accepttext, boolean ab_resetflag, powerobject apo_requestor);//////////////////////////////////////////////////////////////////////////////
//
//	Function:	of_Update
//
//	Access:		public
//
//	Arguments:  
//	ab_accepttext	When applicable, specifying whether control should perform an
//						AcceptText prior to performing the update:
//	ab_resetflag	Value specifying whether object should automatically 
//						reset its update flags.
//	apo_requestor	An object requesting the update within a transaction.
//
//	Returns: Integer
//	 1 = The update was successfull
//	 0 = No Action taken
//	-1 = The update failed
//
//	Description:  	
//	Execute the specific Update logic.  
//
// Note:
//	Specific Update logic should be coded in descendant pfc_Update event.
//	Part of the SelfUpdatingObject(SUO) API.
//	No Action will be executed, If the object is not Updateable.
//
//////////////////////////////////////////////////////////////////////////////
//	
//	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.
//
//////////////////////////////////////////////////////////////////////////////

integer		li_rc
powerobject lpo_updatearray[]
powerobject lpo_pending[]
powerobject	lpo_notvalid

// Make sure there is something to take action on.
If Not of_IsUpdateable() Then Return NO_ACTION

// Set the object requesting the update.
If of_SetUpdateRequestor(apo_requestor) <0 Then Return -1

// Ask the LUW to present itself as the original update requestor (create if necessary).
If IsNull(inv_luw) Or Not IsValid (inv_luw) Then of_SetLogicalUnitofWork(True)
If IsValid(inv_luw) Then 
	inv_luw.of_SetUpdateRequestor(apo_requestor)
End If
	
If UpperBound(ipo_pendingupdates) > 0 Then
	// Should be part of a SUO unit.
	lpo_pending = ipo_pendingupdates
Else
	// Might not be part of an SUO unit.  Need to know what objects had updatespending. 
	this.of_GetObjects(lpo_updatearray)
	If this.Event pfc_UpdatesPending(lpo_updatearray, lpo_pending) < 0 Then
		Return -1
	End If
End If

// Perform the actual update.
li_rc = this.Event pfc_update(lpo_pending, ab_accepttext, ab_resetflag)
	
// Clear the object which requested the update.
of_SetUpdateRequestor(lpo_notvalid)
If IsValid(inv_luw) Then 
	inv_luw.of_SetUpdateRequestor(lpo_notvalid)
End If

Return li_rc

end function

     
Name Owner
No Data

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_luw.of_setupdaterequestor pfc_n_cst_luw
pfc_u_tvs.of_setlogicalunitofwork pfc_u_tvs
pfc_u_tvs.of_isupdateable pfc_u_tvs
pfc_u_tvs.of_setupdaterequestor pfc_u_tvs
pfc_u_tvs.of_getobjects pfc_u_tvs
pfc_u_tvs.pfc_updatespending pfc_u_tvs
pfc_u_tvs.pfc_update pfc_u_tvs

     
Full name
No Data

     
Name Scope
No Data