• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security and Formatting Options
      • Base Actions
      • Application Namespace
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
        • UI Action Invoker Namespace
        • UI.alert Action
        • UI.closeDialog Action
        • UI.enumerateWebViews Action
        • UI.getDisplayOptions Action
        • UI.getInputData Action
        • UI.getMaxDisplayDimensions Action
        • UI.postWebMessage Action
        • UI.setDisplayOptions Action
        • UI.showDialog Action
        • UI.view Action
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

UI.closeDialog Action

Format
s = CS.UI.closeDialog(ʃresult := ...ʅ)
ArgumentDescriptionTypes / Required
resultThe result to return.string, number, boolean, array, object
not required
Description
The UI.closeDialog action closes the current HTML dialog or web view. An optional result can be provided, which serves as the return value for an action like UI.showDialog.
This action has an impact in the following scenarios:
  • Displaying a HTML dialog using UI.showDialog (or htmldialog).
  • Display a web view using UI.view (or view).
  • Displaying HTML using CSCode or CSView.
Return Value
The action returns a boolean value indicating if a dialog successfully closed.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form.
Example (HTML + JavaScript)
This example uses the asynchronous version of UI.closeDialog to ensure that the action does not block the current thread:
<script>
    const CS = new CSProActionInvoker();

    CS.UI.closeDialogAsync({
        result: {
            userName: document.getElementById("userName").value,
            password: document.getElementById("password").value,
        }
    });
</script>
See also: UI Action Invoker Namespace, UI.showDialog Action, UI.view Action