of_register


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_dropdownsearch   >   of_register   

Full name pfc_n_cst_dwsrv_dropdownsearch.of_register
Access public
Extend of integer
Return value integer
Prototype public function integer of_register()

Name Datatype
No Data

Name Datatype
ldwc_obj datawindowchild
li_colcount integer
li_count integer
li_i integer
li_rc integer
ls_colname string
ls_displayvaluecoltype string
ls_displayvaluecolumn string
ls_editstyle string

public function integer of_register ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_Register
//
//	Access: 			public
//
//	Arguments:		None
//
//	Returns: 		integer
//						The number of columns registered.
//						-1 if an error is encountered.
//
//	Description:	
//	 Register all the appropriate dropdowndatawindow and dropdownlistboxe 
//	 columns from the datawindow to have dropdown search capabilities.
//
//	 *Note: For a dropdowndatawindow column to be registered it most have
//	 a display value type char.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.0   Initial version - Replaces obsoleted function of_AddColumn.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////
integer		li_colcount, li_i, li_count, li_rc
string		ls_editstyle, ls_displayvaluecolumn, ls_displayvaluecoltype
string		ls_colname
datawindowchild ldwc_obj

// Get the number of columns in the datawindow object
li_colcount = integer(idw_requestor.object.datawindow.Column.Count)

// Loop around all columns looking for dddw or ddlb columns.
For li_i=1 to li_colcount
	//Get-Validate the name and edit style of the column.
	ls_editstyle = idw_requestor.Describe("#"+string(li_i)+".Edit.Style")
	ls_colname = idw_requestor.Describe("#"+string(li_i)+".Name")
	If ls_colname = '!' or ls_editstyle = '!' Then Return -1	

	If ls_editstyle = 'dddw' Then
		// Get the displayvalue column name.
		ls_displayvaluecolumn = idw_requestor.Describe(ls_colname+".dddw.displaycolumn")
		If ls_displayvaluecolumn = '!' Then Return -1

		// Get a reference to the DropDownDatawindow.
		li_rc = idw_requestor.GetChild(ls_colname, ldwc_obj)
		If li_rc<>1 Then Return -1
		
		// If displayvalue column is not of type "Char," skip it.	
		ls_displayvaluecoltype = ldwc_obj.Describe(ls_displayvaluecolumn+".coltype")
		If pos(ls_displayvaluecoltype, "char") >= 1 Then
			// Add entry into array.
			li_count = upperbound(inv_columns)+1
			inv_columns[li_count].s_editstyle	= ls_editstyle
			inv_columns[li_count].s_columnname = ls_colname
			inv_columns[li_count].dwc_object   = ldwc_obj
		End If
	ElseIf ls_editstyle = 'ddlb' Then
		// Add entry into array.
		li_count = upperbound(inv_columns)+1
		inv_columns[li_count].s_editstyle	= ls_editstyle
		inv_columns[li_count].s_columnname = ls_colname		
	End If
Next

Return upperbound(inv_columns)
end function

     
Name Owner
pfc_n_cst_dwsrv_dropdownsearch.of_addcolumn pfc_n_cst_dwsrv_dropdownsearch

     
Name Owner
datawindow.describe datawindow
datawindow.getchild datawindow
datawindowchild.describe datawindowchild
systemfunctions.integer systemfunctions
systemfunctions.pos systemfunctions
systemfunctions.string systemfunctions
systemfunctions.upperbound systemfunctions

     
Full name
No Data

     
Name Scope
No Data