TComponents. Popup_A

Members

(static) CANCEL :string

'cancel'

Type:
  • string

(static) OK :string

'ok'

Type:
  • string

(static) cancel

'cancel'

(static) ok

'ok'

Deprecated

enabled

show

Methods

confirm(msg1, msg_arrayopt, callbackopt)

A popup dialog is a modal window that provides "OK/Cancel" confirmation dialog.

Parameters:
NameTypeAttributesDescription
msg1string

A string, describing the topic of the message.

msg_arraystring | Array.<string><optional>

The actual message. It can be either a simple string or, if several lines are required, an array where each element is a string with a message line.

callbackfunction<optional>

A function that will be called when the user dismisses by pressing the 'OK' or 'Cancel' button.

Example
TComponents.Popup_A.confirm(
  `XXX module not yet loaded on the controller`,
  ['This module is required for this WebApp.', 'Do you want to load the module?'],
  (action) => {
   if (action === 'ok') {
     console.log("Load the module here...")
   } else if (action == 'cancel') {
     console.log("Abort mission!");
   }
 }
);

danger(msg1, msg_arrayopt, callbackopt)

A popup dialog is a modal window that provides the user with danger messages.

Parameters:
NameTypeAttributesDescription
msg1string

A string, describing the topic of the message.

msg_arraystring | Array.<string><optional>

The actual message. It can be either a simple string or, if several lines are required, an array where each element is a string with a message line.

callbackfunction<optional>

A function that will be called when the user dismisses by pressing the 'OK' or 'Cancel' button.

Example
try {
   // do something
 } catch (e) {
   TComponents.Popup_A.danger('Something went wrong', [e.message, e.description]);
 }

error(e)

A popup dialog is a modal window that provides the user with error messages.

Parameters:
NameTypeDescription
eobject

Error object for example, errorthrown by Omnicore RWS

To Do
  • Optimize the parsing of error object
Example
try {
   throw new Error("Whoops!");
 } catch (e) {
   TComponents.Popup_A.error(e, 'Custom title');
 };

info(msg1, msg_arrayopt, callbackopt)

A popup dialog is a modal window that provides the user with information messages. The main difference from the Popup_A.message is that Popup_A.info includes an "i" image in the modal window.

Parameters:
NameTypeAttributesDescription
msg1string

A string, describing the topic of the message.

msg_arraystring | Array.<string><optional>

The actual message. It can be either a simple string or, if several lines are required, an array where each element is a string with a message line.

callbackfunction<optional>

A function that will be called when the user dismisses by pressing the 'OK' or 'Cancel' button.

Example
TComponents.Popup_A.info(
  "Important information!",
  [
    "For your information, this is a popup dialog.",
    "",
    "Further information can be given here!"
  ],
 function (action) {
   console.log("OK button was clicked")
 });

message(msg1, msg_arrayopt, callbackopt)

A popup dialog is a modal window that provides the user with information messages.

Parameters:
NameTypeAttributesDescription
msg1string

A string, describing the topic of the message.

msg_arraystring | Array.<string><optional>

The actual message. It can be either a simple string or, if several lines are required, an array where each element is a string with a message line.

callbackfunction<optional>

A function that will be called when the user dismisses by pressing the 'OK' or 'Cancel' button.

Example
TComponents.Popup_A.message(
  "Important message!",
  [
    "For your information, this is a popup dialog.",
    "",
    "Further information can be given here!"
  ],
 function (action) {
   console.log("OK button was clicked")
 });

warning(msg1, msg_arrayopt, callbackopt)

A popup dialog is a modal window that provides the user with warning messages.

Parameters:
NameTypeAttributesDescription
msg1string

A string, describing the topic of the message.

msg_arraystring | Array.<string><optional>

The actual message. It can be either a simple string or, if several lines are required, an array where each element is a string with a message line.

callbackfunction<optional>

A function that will be called when the user dismisses by pressing the 'OK' or 'Cancel' button.

Example
try {
   // do something
 } catch (e) {
   Popup_A.waring('Something went wrong', [e.message, e.description]);
 }