Namespace

ui

mx.ui

Basic UI functionality.

Methods

# async static back() → {Promise.<void>}

Goes one step back in history, closing the current in content Form.

Promise.<void>

# static confirmation() → {void}

Shows a confirmation dialog before calling a given function.

Parameters:
Name Type Description
args.content string

message to show in the dialog

args.proceed string

caption for the proceed button

args.cancel string

caption for the cancel button

args.handler mx.ui~ConfirmationCallback

function to call when the proceed button is clicked

void
Example
mx.ui.confirmation({
    content: "Do you really want to eat a burger?",
    proceed: "I really do",
    cancel: "I'll pass",
    handler: function() {
        console.log("eating burger");
    }
});

# static error(msg, modal)

Shows an error message.

Parameters:
Name Type Description
msg string

message to show

modal boolean

whether the dialog will be modal or not

Example
mx.ui.error("Something went wrong."); // shows a non-modal error

# static exception(msg)

Shows a message for a fatal error in a modal dialog.

Parameters:
Name Type Description
msg string

message to show

Example
mx.ui.exception("Something went very wrong."); // shows a modal fatal error

# static hideProgress(progressId) → {void}

Hides the loading dialog.

Parameters:
Name Type Description
progressId number
void
Example
var pid = mx.ui.showProgress(); // show progress dialog
mx.ui.hideProgress(pid); // hide it again

# static info(msg, modal)

Shows an information message.

Parameters:
Name Type Description
msg string

message to show

modal boolean

whether the dialog will be modal or not

Example
mx.ui.info("Let me inform you about something.", false); // shows a non-modal warning

# async static showLogin(messageCodeopt) → {Promise.<void>}

Shows the login screen if it is not already shown.

Parameters:
Name Type Attributes Description
messageCode number <optional>

HTTP code triggering the login

Promise.<void>
Example
mx.ui.showLogin(401); // show login screen with indication that session has expired.

# static showProgress(messageopt, isModalopt) → {number}

Shows the loading dialog.

Parameters:
Name Type Attributes Description
message string <optional>

message to display while progress is visible

isModal boolean <optional>

whether the progress should be modal

progress id that can be used to close the dialog again

number
Examples

Showing default progress dialog

var pid = mx.ui.showProgress(); // show progress dialog
mx.ui.hideProgress(pid); // hide it again

Showing a modal progress dialog with a message

var pid = mx.ui.showProgress("In progress", true);
mx.ui.hideProgress(pid);

# static warning(msg, modal)

Shows a warning message.

Parameters:
Name Type Description
msg string

message to show

modal boolean

whether the dialog will be modal or not

Example
mx.ui.warning("Let me warn you about something.", true); // shows a modal warning

Type Definitions

# ConfirmationCallback()

Callback for mx.ui.confirmation for when the user confirms