phmPromptSeedBufferCallback - cWebPromptList
Defines a custom message to be sent to the invoking object to seed the prompt list's file buffer
Type: Property
Access: Read/Write
Data Type: Handle
Parameters: None
Syntax
Property Handle phmPromptSeedBufferCallback
| Access Type | Syntax |
|---|---|
| Read Access: | Get phmPromptSeedBufferCallback to HandleVariable |
| Write Access: | Set phmPromptSeedBufferCallback to HandleVariable/Value |
Description
Normally, the seeding process is determined relationally (peUpdateMode is umPromptRelational) or through the use of piUpdateColumn and psSeedValue. The buffer will be seeded and an initial record will be found. This all occurs inside of SeedData.
If this seeding process is not sufficient, you can override it by setting the callback property phmPromptSeedBufferCallback. If set, this will contain a callback event that will be sent to the invoking object. That event is then used to seed your table buffer. The seed event is passed the object handle of the prompt list.
Note that this is not a web property. Therefore, this should be set statically within the prompt object and should not be WebSet or Set dynamically inside of the invoking object's Prompt_Callback. (This may change in the future.)
When called, the table buffer is cleared. If you seed the buffer, that inactive seeded buffer will be used for the find within SeedData.
WebPublishProcedure SeedBuffer
WebPublishProcedure PromptUpdateCallback
// set within your cWebForm
Procedure SeedBuffer Handle hoPrompt
WebGet Value of oDivision to Customer.Division
WebGet Value to Customer.Customer_Number
End_Procedure
Procedure Prompt_Callback Integer hPrompt
Set phmPromptSeedBufferCallback of hPrompt to (RefProc(SeedBuffer))
WebSet psPromptUpdateCallback of hoPrompt to "PromptUpdateCallback"
WebSet peUpdateMode of hPrompt to umPromptValue
WebSet piUpdateColumn of hPrompt to 0
End_Procedure
If you seed the buffer and find the record yourself, that active record will be used as your seed.
// set within your cWebForm
Procedure SeedBuffer Handle hoPrompt
Handle hoServer
Get Server to hoServer
WebGet psValue to Customer.Customer_Number
WebGet psValue of oDivision to Customer.Division
// first search in supplied division
Send Request_Read of hoServer GE Customer.File_Number 3
If (Not(found)) Begin
// if not found, search in unassigned division
Move "NONE" to Customer.Division
Send Request_Read of hoServer GE Customer.File_Number 3
End
End_Procedure
Procedure Prompt_Callback Integer hPrompt
Set phmPromptSeedBufferCallback of hPrompt to (RefProc(SeedBuffer))
WebSet psPromptUpdateCallback of hoPrompt to "PromptUpdateCallback"
WebSet peUpdateMode of hPrompt to umPromptValue
End_Procedure
Procedure OnPrompt
Send Popup of oCustomerWebLookup (Self)
End_Procedure
The phmPromptSeedBufferCallback is not used when peUpdateMode is umPromptNonInvoking, as there is no invoking object to callback to.
See Also