of_postupdate


pfcapsrv.pbl   >   pfc_n_cst_luw   >   of_postupdate   

Full name pfc_n_cst_luw.of_postupdate
Access public
Extend of integer
Return value integer
Prototype public function integer of_postupdate(powerobject[])

Name Datatype
No Data

Name Datatype
la_rc Any
lb_defined Boolean
lds_nonpfc DataStore
ldw_nonpfc DataWindow
li_i Integer
li_max Integer
li_rc Integer
lpo_tocheck PowerObject
ls_args String[]
ltab_control tab
luo_control UserObject
lw_control window

public function integer of_postupdate (powerobject apo_control[]);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  
//	of_postupdate
//
//	Access:  public
//
//	Arguments:  
//	apo_control[]  Array of controls that need processing.
//
//	Returns:  integer 
//	 1 = success
//	-1 = fail
//
//	Description:
//	Resets the datawindow update flags on a successful save
//
//	Note:	 
//	This function is called recursively to handle tab controls and user objects.
//////////////////////////////////////////////////////////////////////////////
//	
//	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_rc
Integer		li_max
Integer		li_i
Integer		li_rc
String		ls_args[]
Boolean		lb_defined
PowerObject lpo_tocheck
UserObject	luo_control
tab			ltab_control
window		lw_control
DataWindow	ldw_nonpfc
DataStore	lds_nonpfc

// If requested use the assist funtionality.
If ib_assist Then 
	of_Assist(is_instancename+'.of_PostUpdate('+of_GetClassNames(apo_control)+')')
End If

// Loop thru all the objects
li_max = UpperBound (apo_control)
For li_i = 1 to li_max
	lpo_tocheck = apo_control[li_i]
	If IsNull(lpo_tocheck) or Not IsValid(lpo_tocheck) Then Continue
	
	Choose Case TypeOf ( lpo_tocheck )

		// Windows!, Tabs!, and UserObjects! can either be SelfUpdatingObjects (SUO) or
		// they can be controls which may be holding SelfUpdatingObjects.
		// If they are found to be SUO then they will treated as such, if not their
		// respective control array will be traversed in search of other SUOs.

		Case Window!
			If Not of_IsSelfUpdatingObject (lpo_tocheck) Then					
				// Test for Window Controls (which may contain SelfUpdatingObjects)
				lw_control = lpo_tocheck
				li_rc = This.of_PostUpdate ( lw_control.control ) 
				If li_rc < 0 Then Return -1
				Continue
			End If

		Case Tab!
			If Not of_IsSelfUpdatingObject (lpo_tocheck) Then					
				// Test for Tab Controls (which contain TabPages which may contain SelfUpdatingObjects)
				ltab_control = lpo_tocheck
				li_rc = This.of_PostUpdate ( ltab_control.control ) 
				If li_rc < 0 Then Return -1
				Continue
			End If

		Case UserObject!
			If Not of_IsSelfUpdatingObject (lpo_tocheck) Then							
				// Test for UserObjects (which may contain SelfUpdatingObjects)
				luo_control = lpo_tocheck
				li_rc = This.of_PostUpdate ( luo_control.control ) 
				If li_rc < 0 Then Return -1
				Continue
			End If

	End Choose
		
	// -- An object which 'may' be a SUO has been encountered. --		
		
	// Determine if the SUO type is one the service has been asked to process.
	If Len (is_typetoprocess) > 0 Then
		If Pos (is_typetoprocess, of_GetType(lpo_tocheck)) = 0 Then
			// Not a SUO type the service has been asked to process.
			Continue
		End If
	End If					
		
	// Check/Perform for SelfUpdatingObject Functionality.
	lb_defined = inv_metaclass.of_isFunctionDefined &
		(lpo_tocheck.ClassDefinition, "of_PostUpdate", ls_args)
	If lb_defined Then
		li_rc = lpo_tocheck.Function Dynamic of_PostUpdate ()
		If li_rc < 0 Then Return -1
		Continue
	End If
	
	// Handle Reseting of NonPFC DataWindows/DataStores.
	If TypeOf (lpo_tocheck) = DataWindow! Then
		ldw_nonpfc = lpo_tocheck
		If ldw_nonpfc.ResetUpdate() < 0 Then
			Return -1
		End If
	ElseIf TypeOf (lpo_tocheck) = DataStore! Then
		lds_nonpfc = lpo_tocheck
		If lds_nonpfc.ResetUpdate() < 0 Then
			Return -1
		End If
	End If	
				
Next

// All were successful.
Return 1

end function

     
Name Owner
pfc_n_cst_luw.of_postupdate pfc_n_cst_luw
pfc_n_cst_luw.of_save pfc_n_cst_luw
pfc_u_lvs.pfc_postupdate pfc_u_lvs
pfc_u_tab.pfc_postupdate pfc_u_tab
pfc_u_tvs.pfc_postupdate pfc_u_tvs
pfc_w_master.pfc_postupdate pfc_w_master
pfc_u_base.pfc_postupdate pfc_u_base

     
Name Owner
powerobject.typeof powerobject
datawindow.resetupdate datawindow
datastore.resetupdate datastore
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.pos systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_metaclass.of_isfunctiondefined pfc_n_cst_metaclass
pfc_n_cst_luw.of_postupdate pfc_n_cst_luw
pfc_n_cst_luw.of_getclassnames pfc_n_cst_luw
pfc_n_cst_luw.of_assist pfc_n_cst_luw
pfc_n_cst_luw.of_isselfupdatingobject pfc_n_cst_luw
pfc_n_cst_luw.of_gettype pfc_n_cst_luw

     
Full name
No Data

     
Name Scope
No Data