peUpdateMode - cWebPromptList

Determines the initialization and update mode that the prompt list uses

Type: Property (Web Property)

Access: Read/Write

Data Type: Integer

Parameters: None

Syntax
 { WebProperty=Client }
 Property Integer peUpdateMode

Web Property Read Access: WebGet peUpdateMode to IntegerVariable
Web Property Write Access: WebSet peUpdateMode to IntegerVariable/Value

Read Access: Get peUpdateMode to IntegerVariable
Write Access: Set peUpdateMode to IntegerVariable/Value


Description

peUpdateMode determines how the prompt list will be used. The mode can determine how the list will be initially seeded, what the initial column and ordering will be and how the selection will be handled.

Posible values are:.

ConstantMeaning
umPromptRelationalThe prompt list is being used as a relational prompt list.
umPromptValueThe prompt list is used to update the Value property of the invoking object.
umPromptCustomThe prompt list has an invoking object but there is no automatic update of selected data.
umPromptNonInvokingThe prompt list has no invoking object and no automatic update.


The default for a prompt list is umPromptRelational. If this default is changed, it is often changed temporarily within the invoking object's Prompt_Callback event. If changed within Prompt_Callback, the original mode (probably umPromptRelational) will be restored when prompt list is closed.

umPromptRelational


By default, a prompt list is meant to be used in a relational fashion, where the invoking object (the object that had the focus when the prompt list was activated) is a data entry object (DEO) with binding table data that is the same as the prompt list's DD Main_File. In other words, the table component of the invoking object's Entry_Item Table.Column command will be the same prompt list's main table, which is determined by its DD's Main_File.

When used in this fashion, prompt lists "just work". The prompt list will be seeded with the data provided from the invoking object's view, the initial column and initial order will be based on the invoking object's binding data, and a selection will result in the selected record being returned to the invoking object's DD, which will refresh the entire view.

If peUpdateMode is umPromptRelational, it expects that a proper relation exists between the invoking object and the prompt list. If the relationship is not proper, the OnRelationalPromptListError event is sent, which generates an unhandled runtime error. You could augment OnRelationalPromptListError to change update modes instead of generating an error. While this makes the prompt list more automatic, it makes it easier to misuse the prompt list.

umPromptValue


If peUpdateMode is set to umPromptValue, the update will be local to invoking object and the prompt list's piUpdateColumn property. The invoking object does not need to be a DEO, but it must support the psValue property. When invoked, the data from the invoking object will be moved to the prompt list and seeded based on the binding and ordering of piUpdateColumn. Upon selection, the value from the selected row's piUpdateColumn will be set to the invoking objects Value property.

Typically, this mode is set inside of the invoking object's Prompt_CallBack event. You will usually set this property and set piUpdateColumn.

umPromptCustom


If peUpdateMode is set to umPromptCustom, the update will still expect an invoking object, but the seeding and update process must be manually coded. The invoking object can be an object that understands the Prompt event. It does not need to be a DEO and it does not need to support the psValue property.

Typically, this mode is set inside of the invoking object's Prompt_CallBack event.

Object oCustomerCustomer_Number is a cWebForm
    Entry_Item Customer.Customer_Number
    Set piColumnSpan to 3
    Set piColumnIndex to 3
    Set psLabel to "Customer Num:"
    Set peLabelAlign to alignRight

    WebPublishProcedure PromptUpdateCallback 
    Procedure PromptUpdateCallback Handle hoPrompt
        Handle hoDD
        RowID riId
        Get Server of hoPrompt to hoDD    // this is the prompt's DD
        // the DD has all current DD information as does the file buffer
        // do your custom update here.       
    End_Procedure
    
    Procedure Prompt_Callback Handle hoPrompt
        WebSet psPromptUpdateCallback of hoPrompt to "PromptUpdateCallback"
        WebSet peUpdateMode of hoPrompt to umPromptCustom
    End_Procedure

End_Object

When using this mode, you can create your own update callback by setting the psPromptUpdateCallback message. In addition, you will usually set the piUpdateColumn and psSeedValue properties to seed the list.

umPromptNonInvoking


If peUpdateMode is set to umPromptNonInvoking, there is no invoking object at all and therefore, there can be no communication between the prompt list and an invoking object. This mode is typically used when you wish to create your own interface in your prompt list's modal panel container. Instead of sending Popup to this object, you send a custom message which manages the entire process. While using this mode requires extra work, it is the most flexible of the non-relational approaches because the prompt list panel controls the entire process and objects using this need know nothing about how the list is configured. The invoking object simply uses a predefined interface that passes and returns data.


About Web Properties
Each web property maintains two values: The regular property value is set during object creation and should not be changed during the lifetime of that object. To access that value, use the standard property Get and Set syntax.
The web property value is the local value stored at each client. This is synchronized to the client's local value whenever a server call is being processed. To access the web property value, use the WebGet and WebSet syntax above instead of the standard Get and Set syntax.