pfc_rowfocuschanged


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_linkage   >   pfc_rowfocuschanged   

Full name pfc_n_cst_dwsrv_linkage.pfc_rowfocuschanged
Access public
Extend of integer
Return value integer
Prototype event integer pfc_rowfocuschanged(long)

Name Datatype
No Data

Name Datatype
lb_preventfocuschanged boolean
li_detail Integer
li_numdetails Integer
li_rc Integer

event pfc_rowfocuschanged;call super::pfc_rowfocuschanged;//////////////////////////////////////////////////////////////////////////////
//
//	Event:  			pfc_rowfocuschanged
//
//	(Arguments: 	None)
//
//	(Returns:  		Integer
// 1 if it succeeds and -1 if an error occurs. 
//
//	Description:  	
//	Notify each of the detail datawindows attached to the requestor that rowfocus
//	has changed.  Contents of the current row requires the datawindows to refresh
//	themselves.  Details are refresh based on values on the requestor's current row.
//
//	This event is fired automatically from pfc_u_dw's RowFocusChanged
//	and pfc_rowchanged events.   You may call this event, from other situations
// where you want details refreshed.
//
//////////////////////////////////////////////////////////////////////////////
//	
//	Revision History
//
//	Version
//	5.0   Initial version
// 5.0.02 Check the detail's style instead of assuming the detail style matches
//			 the master's style.
//	6.0	Changed to use service Constants and not to use obsoleted functions.
// 6.0 	Enhanced with Prevent focus changed functionality.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_numdetails
Integer	li_detail
Integer	li_rc
boolean	lb_preventfocuschanged

//If IsValid(gnv_app.inv_debug) Then 
//	gnv_app.inv_debug.of_message(idw_requestor.ClassName()+ '.Linkage.PFC_RowFocusChanged'+&
//		' al_row='+string(al_row)+ ' RowCount='+string(idw_requestor.RowCount()))
//End If

// Reset the Prevent focus funtionality.
lb_preventfocuschanged = ib_preventfocuschanged
ib_preventfocuschanged = False

// Check the arguments.
al_row = idw_Requestor.GetRow()
If IsNull(al_row) Then Return -1

// Check for the prevent focus changed functionality.
If lb_preventfocuschanged Then Return 1

// Determine how many details are subordinate to the requestor. (if none stop processing).
li_numdetails = UpperBound ( idw_details ) 
If li_numdetails = 0 Then Return 1

// Loop through the valid details and Refresh each detail.
For li_detail = 1 to li_numdetails 
	
	If IsNull(idw_details[li_detail]) Or &
		Not IsValid (idw_details[li_detail]) Then Continue //Continue with next detail dw.
	If IsNull(idw_details[li_detail].inv_Linkage) Or &
		Not IsValid (idw_details[li_detail].inv_Linkage) Then Return -1

	// Check the style of the detail datawindow.  (if using retrieval arguments to refresh.)
	If idw_details[li_detail].inv_linkage.of_GetStyle() = RETRIEVE Then
		If al_row <= 0 Then
			// If the requestor's has no rows, then clear the detail dws. 
			li_rc = idw_details[li_detail].inv_Linkage.of_Reset()
			Continue		
		End If
		If idw_requestor.GetItemStatus (al_row, 0, Primary!) = New! &
			or idw_requestor.GetItemStatus (al_row, 0, Primary!) = NewModified! Then
			// If the requestor's or row is new, then clear the detail dws.
			li_rc = idw_details[li_detail].inv_Linkage.of_Reset()
			Continue
		End If
	End If
	
	// Refresh the data.
	li_rc = idw_details[li_detail].inv_Linkage.of_Refresh (al_row) 
	If li_rc < 0 Then
		idw_Requestor.ScrollToRow(il_priorrow)
		idw_Requestor.SetRow(il_priorrow) 		
		Return li_rc
	ElseIf li_rc = 1 Then
		il_priorrow = idw_Requestor.GetRow() 
		li_rc = idw_details[li_detail].inv_Linkage.Event pfc_rowfocuschanged (idw_details[li_detail].GetRow() ) 			
	End If
Next

Return li_rc

end event

     
Name Owner
pfc_n_cst_dwsrv_linkage.of_retrieve pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.pfc_rowfocuschanged pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.pfc_insertrow pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.pfc_deleterow pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.pfc_itemchanged pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.pfc_rowchanged pfc_n_cst_dwsrv_linkage
pfc_u_dw.rowfocuschanged pfc_u_dw

     
Name Owner
datawindow.getitemstatus datawindow
datawindow.getrow datawindow
datawindow.scrolltorow datawindow
datawindow.setrow datawindow
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_dwsrv_linkage.of_reset pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.of_refresh pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.of_getstyle pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.pfc_rowfocuschanged pfc_n_cst_dwsrv_linkage

     
Full name
No Data

     
Name Scope
No Data