|
of_refreshdddws
|
|
Full name
|
pfc_n_cst_dwsrv.of_refreshdddws
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_refreshdddws()
|
Name
|
Datatype
|
lb_dddwrefreshed
|
boolean
|
ldwc_obj
|
DataWindowChild
|
ll_cnt
|
Long
|
ll_columncount
|
Long
|
ll_dddwcount
|
Long
|
ll_rc
|
Long
|
ls_args
|
String[]
|
ls_colname
|
String
|
ls_dddwdatacolumn
|
String
|
ls_types
|
String[]
|
public function integer of_refreshdddws ();//////////////////////////////////////////////////////////////////////////////
//
// Function: of_RefreshDDDWs
//
// Access: Public
//
// Arguments: None
//
// Returns: Integer
// The number of dddw-style columns found and refreshed.
// -1 if an error occurs.
//
// Description: To determine what columns have a DropDownDataWindow style
// and to refresh the dddw.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 5.0.02 Handle cases where the column having a child datawindow does not
// equal the dropdowndatawindow column name.
// 5.0.02 Check for required references and added error checking.
// 6.0 Marked obsolete Replaced by of_PopulateDDDWs(...).
//
//////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////
Long ll_rc
Long ll_cnt
Long ll_columncount
Long ll_dddwcount
String ls_colname
String ls_dddwdatacolumn
String ls_args[]
String ls_types[]
boolean lb_dddwrefreshed=False
DataWindowChild ldwc_obj
// Check required references.
If IsNull(idw_Requestor) or Not IsValid(idw_Requestor) Then Return -1
// Get the number of columns on the datawindow.
ll_columncount = Long (idw_Requestor.Describe("DataWindow.Column.Count"))
// Loop around all columns.
FOR ll_cnt=1 TO ll_columncount
// Reset boolean which states if dddw is refreshed.
lb_dddwrefreshed=False
// Get the current column name.
ls_colname = idw_Requestor.Describe ( "#" + String ( ll_cnt ) + ".Name" )
// Determine if the current column is a DropDownDataWindow.
ls_dddwdatacolumn = idw_Requestor.Describe ( ls_colname + ".DDDW.DataColumn" )
IF ls_dddwdatacolumn = "" OR ls_dddwdatacolumn = "?" THEN
// Not a DropDownDataWindow.
CONTINUE
ELSE
// Get the Child reference.
ll_rc = idw_Requestor.GetChild (ls_colname, ldwc_obj)
If ll_rc > 0 Then
// A DropDownDataWindow has been found.
IF of_DWArguments ( ldwc_obj, ls_args, ls_types ) > 0 THEN
// DropDownDataWindow has arguments, call event which will handle this case.
ll_rc = idw_Requestor.Event pfc_retrievedddw(ls_colname)
If ll_rc < 0 Then Return -1
lb_dddwrefreshed = True
ELSE
// DropDownDataWindow does not have arguments, refresh the data.
If IsValid(idw_Requestor.itr_object) Then
ll_rc = ldwc_obj.SetTransObject(idw_Requestor.itr_object)
If ll_rc < 0 Then Return -1
ll_rc = ldwc_obj.Retrieve()
If ll_rc < 0 Then Return -1
lb_dddwrefreshed = True
End If
END IF
If lb_dddwrefreshed Then
// Increment the DropDownDataWindow count.
ll_dddwcount++
End If
End If
END IF
NEXT
Return ll_dddwcount
end function
Name
|
Owner
|
datawindow.describe |
datawindow
|
datawindow.getchild |
datawindow
|
datawindowchild.retrieve |
datawindowchild
|
datawindowchild.settransobject |
datawindowchild
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.isvalid |
systemfunctions
|
systemfunctions.long |
systemfunctions
|
systemfunctions.string |
systemfunctions
|
pfc_n_cst_dwsrv.of_dwarguments |
pfc_n_cst_dwsrv
|
pfc_u_dw.pfc_retrievedddw |
pfc_u_dw
|