Skip to content

phmPromptUpdateCallback - cDbCJGridPromptList

Defines a custom message to be sent to the invoking object as part of the selection update process

Type: Property
Access: Read/Write
Data Type: Handle
Parameters: None

Syntax

Property Handle phmPromptUpdateCallback
Access Type Syntax
Read Access: Get phmPromptUpdateCallback to HandleVariable
Write Access: Set phmPromptUpdateCallback to HandleVariable/Value

Description

If phmPromptUpdateCallback is set to an event message, this event will be called as part of the prompt list's selection and update process. It calls the event and passed handle of the prompt object. This is called in addition to and after the normal update. Normally, you will only use this when peUpdateMode is umPromptCustom, since the umPromptCustom mode has no automatic mechanism for updating a selection.

This property is normally set within the invoking object's Prompt_Callback event.

Object oButton1 is a Button
    Set Location to 100 100

    Procedure PromptUpdate Handle hoPrompt
        String[] SelectedNames                    

        Get SelectedColumnValues of hoPrompt 1 to SelectedNames
        If (SizeOfArray(SelectedNames)) Begin
            Set Value of oMyStartForm to SelectedNames[0]
        End
    End_Procedure   

    Procedure Prompt_Callback Integer hPrompt
        String sValue

        Set peUpdateMode of hPrompt to umPromptCustom
        Set piUpdateColumn of hPrompt to 1 // on name column
        Set phmPromptUpdateCallback of hPrompt to (RefProc(PromptUpdate))
        Get Value of oMyStartForm to sValue
        Set psSeedValue of hPrompt to sValue
    End_Procedure

    Procedure OnClick
        Send Popup of Customer_sl
    End_Procedure

End_Object

phmPromptUpdateCallback is not used when peUpdateMode is umPromptNonInvoking, as there is no invoking object to callback to.

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