• <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.view Action

Format
CS.UI.view(path := ... ‖ url := ...,
       
ʃ, inputData := ...  ʅ
       
ʃ, displayOptions := ...ʅ)
ArgumentDescriptionTypes / Required
pathThe path of the file to view.string
not required
urlThe URL to view.string
not required
inputDataThe input data for a viewed web page.string, number, boolean, array, object
not required
displayOptionsThe display options to use when showing the web view.object
not required
Description
The UI.view action displays a file or web page in a new web view. If you would prefer to display HTML in a modal dialog, you can use the UI.showDialog action.
One, and only one, of the arguments path or url must be provided.
Specify inputData if you want to pass input data to the web view, which the web view can retrieve using UI.getInputData.
Optional displayOptions allow you to pass display options to the web view. These are only used on Windows and control how the embedded web browser displays. These options include:
  • "title": string giving the title of the window.
  • "width": number specifying the width of the window in display units.
  • "height": number specifying the height of the window in display units.
  • "showCloseButton" boolean value that, if false, hides the window's Close button.
If either the height or width is specified, then both values must be provided. Hiding the Close button also removes the margin around the web browser, so the browser will fill the entire embedded window.
An alternative way to view files is to use the view function, or to use CSView, which can be launched from logic by creating a PFF and calling Pff.exec.
Return Value
The action returns undefined.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form or if the file does not exist or cannot be read.
Example (CSPro Logic)
// construct the input needed for the questionnaire view
string questionnaireViewInput =
   
maketext("{ \"dictionary\": %s, \"forms\": %s, \"case\": %s }",
             
CS.Dictionary.getDictionary(name := "PLANETS_DICT"),
             
CS.Application.getFormFile(name := "PLANETS_DICT"),
             
CS.Data.getCase(name := "PLANETS_DICT"));

// pass this input to the questionnaire view
CS.UI.view(path := Path.concat(html, "questionnaire-view", "index.html"),
           
inputData := @object questionnaireViewInput);
See also: UI Action Invoker Namespace, UI.closeDialog Action, UI.showDialog Action, View Function