|
pfc_itemchanged
|
|
Full name
|
pfc_n_cst_dwsrv_linkage.pfc_itemchanged
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
event integer pfc_itemchanged(long,dwobject,string)
|
Name
|
Datatype
|
la_newvalue
|
any
|
li_rc
|
integer
|
ls_colname
|
string
|
event pfc_itemchanged;call super::pfc_itemchanged;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_itemchanged
//
// (Arguments:
// al_row
// adwo_object
// as_data)
//
// (Returns: Integer
// 1 if it succeeds and -1 if an error occurs.
//
// Description: Notification that a value has been changed on the requestor
// datawindow. If the column changed is key column, the
// appropriate action will be taken.
// This event is fired automatically from pfc_u_dw's ItemChanged.
//
// *Note: If the changed value needs to be validated. Validation needs to
// occur prior to this linkage.pfc_itemchanged event
// (i.e. u_dw.itemchanged event). If key syncronization is
// performed, then the changed value cannot be undone. (i.e. return codes)
//////////////////////////////////////////////////////////////////////////////
//
// 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
string ls_colname
any la_newvalue
if IsNull(al_row) Or IsNull(adwo_object) then
return -1
end if
// Determine if Syncronization of Key Changes is desired.
if of_IsSyncOnKeyChange() then
// Get the name of the column which just changed.
ls_colname = adwo_object.Name
// Only worry about key column value changes.
if of_IsKey(ls_colname) then
// Confirm that the previous value was captured.
if ls_colname <> is_focuscol then
beep(1)
return -1
end if
// Set the value so that it cannot be undone.
li_rc = of_SetItem (al_row, ls_colname, as_data)
If li_rc <> 1 Then Return -1
// Get the new value into an 'any' variable.
la_newvalue = of_GetItemAny (al_row, ls_colname)
// Disable linkage redrawing starting with this dw (prevent flicker)
of_SetRedraw(False)
// Cascade the changed key value.
of_KeyChanged (al_row, ls_colname, is_focusval, la_newvalue)
// ReApply filters.
If of_GetStyle() = FILTER Then
this.Event pfc_rowfocuschanged(idw_requestor.GetRow())
End If
of_SetRedraw(True)
end if
end if
return 1
end event