SetActionMode - cWebObject

Allows developer to configure a wait dialog for every server-action

Type: Procedure

Parameters: Handle hMessage Integer eMode String sOptWaitMessage

ParameterDescription
hMessageMessage handle
eModeValid values are:

ConstantMeaning
scModeDefault The default mode where the browser application is not locked and multiple actions can be joined to a single action.
scModeWaitLocks the user interface and shows the wait cursor.
scModeProgressLocks the user interface and shows the wait dialog.

sOptWaitMessageOptional message to display


Syntax
Procedure SetActionMode Handle hMessage Integer eMode String sOptWaitMessage

Call: Send SetActionMode hMessage eMode sOptWaitMessage


Description

This advanced feature allows developers to configure a wait dialog for every server-action just as you can with the pbShowWaitDialog property of the cWebButton class.

Instead of adding properties for every server action, a procedure is available that tells the JavaScript Engine to send an action in a specific mode. The SetActionMode procedure takes a message handle to the published procedure or function as a parameter.

Sample

This example shows how to show a wait dialog can be shown while processing the OnClick of a menu item (cWebMenuItem). Other action modes that are available are: scModeWait, which will lock the UI and show a wait cursor and scModeDefault, which doesn't lock the UI and doesn't show a wait cursor.

Object oMenuItem is a cWebMenuItem
    Set psCaption to "Long process"

    Procedure OnLoad
        Forward Send OnLoad

        Send SetActionMode (RefProc(OnClick)) scModeProgress "Please wait while sleeping..."
    End_Procedure

    Procedure OnClick
        //  Do something long
        Sleep 4
    End_Procedure

End_Object


When a server action triggers another server action (like ProcessDataSet on cWebList), then it will keep the wait dialog on the screen until the new server action is processed.

Note: You can only mark published messages that the client sends to the server this way.

See Also

Publishing Web Object Interfaces