ssCore.App.confirmDialog

Confirms the specified dialog by sending it an OK message, which in most cases is the same as pressing the default button. You should only call this command from an onDialog event handler (see App.setNotify).


Availability:

First available in version 3.0 build 2039.


Input Parameters:

hwnd - Window handle of the dialog to be confirmed.


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.App.confirmDialog( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.App.confirmDialog( paramsObject );


Notes:

Using App.setNotify to enable the onDialog event causes all dialogs that are children of your application to start in hidden mode so they can be cancelled or confirmed without becoming visible. Any dialogs that you don't handle by calling App.cancelDialog or App.confirmDialog must be displayed by a call to App.showDialog or they will remain hidden and inaccessible to your users.


Examples:

This example demonstrates how to automatically confirm any Print dialog opened by an application. We do this by handling onDialog events generated by ssCore.App.setNotify and watching for dialogs with a title of "Print". Any dialog that doesn't have the correct title is simply displayed using ssCore.App.showDialog.

ssEvents.addEventListener({listener:this, event:"App.onDialog"});

function onDialog(return_obj)
{
    var a = return_obj.result.split(",");

    var hwndDialog = a[0];
    var isChild = a[1];
    var captionDialog = a[2];
    var captionParent = a[3];

    // only mess with dialogs we own (our children)

    if (isChild == "TRUE")
    {
        if (captionDialog == "Print")
        {
            ssCore.App.confirmDialog({hwnd:hwndDialog});
        }
        else
        {
            ssCore.App.showDialog({hwnd:hwndDialog});
        }
    }
}