TOC : Script API > JavaScript > JavaScript API > GeneralScript > Global > Method >

 

_MessageBox

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

TOC : Script API > JavaScript > JavaScript API > GeneralScript > Global > Method >

 

_MessageBox

 

 

Displays a message box.

 

 

 

Prototype :

 

void _MessageBox

(

        string Contents,

        [ string Title ],

        [ function CallBackFunction ],

        [ string MultiscreenVisibleType ]

)

 

 

 

Arguments :

 

Contents

text to show

Title

message title

CallBackFunction

function to operate when the message window is closed

MultiscreenVisibleType

refer to MultiscreenVisibleTypeConst

When no value is set, the message window is displayed on the active screen

 

 

 

Reference :

 

MultiScreenVisibleType argument only supports multiscreen environment.

 

Script execution order is different depending on the type of viewer.

 

ActiveX Viewer

1) A message box is displayed.

2) Waiting until the user clicks the OK or Cancel button.

3) Run the script set in the CallBackFunction function.

4) Run the script at the bottom of the _MessageBox function.

 

The other Viewers

1) Run the script at the bottom of the _MessageBox function.

2) A message box is displayed.

3) Waiting until the user clicks the OK or Cancel button.

4) Run the script set in the CallBackFunction function.

 

Regardless of the viewer type, to execute a specific action when the message box is closed, enter the desired action in CallBackFunction and no script under _MessageBox.

However, if this function is executed in the GetFieldData/OnAddToPage/OnBind/OnStartBind event in the environment where the viewer is running on mobile, a message box is displayed, but the script entered in CallBackFunction is not executed. In addition, when HTML5JS viewer is executed on the PC, if this function is executed in the GetFieldData/OnStartBind, a message box is displayed, but the script entered in CallBackFunction is not executed.

 

 

 

Example :

 

_MessageBox("Enter your name.");

 

_MessageBox("Enter your name.", "OZ Report");

 

_MessageBox("Enter your name., "OZ Report", function() {

  //Script to run when the user clicks OK or Cancel button

  var objComp = This.GetInputComponent("TextBox1");

  objComp.SetFocus(false);

});

 

_MessageBox("Enter your name.", "OZ Report", function() {

  //Script to run when the user clicks OK or Cancel button

  var objComp = This.GetInputComponent("TextBox1");

  objComp.SetFocus(false);

}, MultiscreenVisibleTypeConst.MainScreenOnly);

 

 

 

Available Events :

 

All events except OnInitialize and OnStartUp

 

 

 

See also :

 

MultiscreenVisibleTypeConst