Prompt_Callback - cCJGridColumn
Sends a callback event to an object that requested a prompt object
Type: Event
Parameters
| Parameter | Type | Description |
|---|---|---|
| hoPrompt | Handle | Handle of prompt object being invoked (usually a cDbCJGridPromptList or a dbList) |
Syntax
Procedure Prompt_Callback Handle hoPrompt
Description
When prompt list objects (cDbCJGridPromptList and dbList) are invoked, they send a callback message to their invoking object. This message, Prompt_Callback, is passed the object handle of the prompt object. This message must be understood by the invoking object. This can be used to customize the prompt object for the particular invoking object. This enables you to use a single prompt list for multiple purposes. Normally, this message sets properties in the cDbCJGridPromptList or the dbList.
For a list of properties most likely to be changed within a cDbCJGridPromptList, see the OnStoreDefaults method for that class.
For a list of properties most likely to be changed within a dbList, see the Store_Defaults method for that class.
If any of these properties is changed by Prompt_Callback, the prompt object will automatically restore them when the list is deactivated. This way, the normal behavior of the list will not be altered when it is used by other invoking objects.
In the following example, a form uses a Customer lookup cDbCJGridPromptList. It defines the prompt list to be 'value style' (as opposed to relational, determined by peUpdateMode) and it identifies the target column as being column 1, which is presumably Customer.Name.
Object oMyForm is a Form
:
Set Prompt_Object to oCustomerSL
// this forces a simple value update for column 1
// (Columns are zero-based, so this will get the value from the 2nd column)
Procedure Prompt_Callback Handle hoPrompt
Set peUpdateMode of hoPrompt to umPromptValue
Set piUpdateColumn of hoPrompt to 1
End_Procedure
End_Object
If you use a custom callback update method (set via phmPromptUpdateCallback) for a cCJGridColumn, the custom method needs to be defined inside the parent grid object, not the grid column object:
// this is pseudo code to demonstrate the proper method location
Object oMyGrid is a cDbCJGrid
// custom callback update method
Procedure PromptUpdate Handle hoPrompt
End_Procedure
Object oMyGridColumn is a cDbCJGridColumn
Procedure Prompt_Callback Integer hPrompt
String sItemNo
Set peUpdateMode of hPrompt to umPromptCustom
Set piUpdateColumn of hPrompt to 0
// this specifies the custom callback update method
Set phmPromptUpdateCallback of hPrompt to (RefProc(PromptUpdate))
Get Value to sItemNo
Set psSeedValue of hPrompt to sItemNo
End_Procedure
End_Object
End_Object