Mendix Client 4 API Documentation


mobile.sys.UI

Methods

action(name, params, scope)

Execute a Microflow.

Parameters

Name Type Description
name String The name of the Microflow to execute. (required)
params.params.applyto String What to apply the Microflow to. Can be one of “none”, “set”, “selection” or “selectionset”. “none” is the default.
params.params.guids1 Array The GUIDs to apply the Microflow to.
params.params.xpath1 String The root entity for the XPath query.
params.params.constraints String The constraints for the XPath query.
params.params.sort2 Array Sorting of XPath query results before feeding them to the Microflow.
params.params.gridid String The grid ID of the data grid which is providing the selection information.
params.context1 MxContext The context for the Microflow.
params.caller Scriptable The caller instance, on which server instructions can be executed.
params.async Boolean Whether the Microflow should be executed asynchronously. Defaults to false.
params.callback Function Function to handle the result when successful. It should take a single parameter, response. response contains the result of the Microflow.
params.error Function Function to handle errors. It should take a single parameter, error, which is set to undefined when the server cannot be accessed, or an Object describing the error.
scope Object The scope in which to execute the callback and error callbacks.

1 One of either the guids or xpath parameters is required.

2 Required when using an XPath query to specify Microflow parameters.

Microflow parameters

The applyto parameter indicates which objects are passed to the Microflow as input.

Name Description
none Don’t pass any objects to the Microflow.
selection Pass the objects with the given GUIDs.
set Pass the objects matching the given XPath query.
selectionset Pass the objects matching the given XPath query. If gridid is set, and the corresponding grid is single selection, only the first queried object is considered.

back()

This method is called to go one step back in history.

lock()

This method is called to lock the screen, so that mouse events are ignored.

unlock()

This method is called to unlock the screen.

showLogin(args)

Show the login screen.

Parameters

Name Type Description
args.no_alert Number Do not show a session expired message, only HTTP errors.
args.http_code Number HTTP code triggering the login.

hideLogin()

Hide the login screen.

showProgress()

This method is called to show the loading icon.

hideProgress()

This method is called to hide the loading icon.

translate(source, str, args, fallback)

Retrieve a string translation.

Parameters

Name Type Description
source String Name of the source of the translation.
str String Identifier for the string to translate.
args Array Values to expand in the translated string.
fallback String String to use when translation was not found.

Returns

Type Description
String The requested translation.

openForm(path, args, scope)

This method is called to open a form in the main content view.

Parameters

Name Type Description
path String The path to the form.
args.params Object Optional params for the form.
args.error Function The function to be called when an error occurs.
args.callback Function The function to be called when ready.
args.dir Number Direction of the open animation: -1 moves left, 1 moves right, 0 for no animation.
args.title String Title of the form. If omitted, the title from the form template is used.
args.context MxContext Context passed to the form.
args.instance Form Previously retrieved form to use instead of retrieving it through path.
scope Object Scope in which the error and callback handler are invoked.

getForm(path, args, scope)

This method is called to get a form instance.

Parameters

Name Type Description
path String The path to the form.
args.params Object Optional params for the form.
args.error Function The function to be called when an error occurs.
args.callback Function The function to be called with the form instance as parameter.
scope Object Scope in which the error and callback handler are invoked.

getConfig(id)

This method is called to get a config for a specific widget.

Parameters

Name Type Description
id String The widget id.

Returns

Type Description
Object Widget config.

getTemplate(id, name)

This method is called to get a template for a specific widget.

Parameters

Name Type Description
id String The widget id.
name String The name of the template.

Returns

Type Description
DOMNode Widget template node.

getLocale()

Retrieve the current locale.

Returns

Type Description
String Locale description

info(msg)

This method is called to show an info message.

Parameters

Name Type Description
msg String The message to show.

warning(msg)

This method is called to show a warning message.

Parameters

Name Type Description
msg String The message to show.

error(msg)

This method is called to show an error message.

Parameters

Name Type Description
msg String The message to show.

exception(msg)

Show a message for a fatal error.

Parameters

Name Type Description
msg String The message to show.

confirmation(args)

Show a confirmation dialog before calling a given function.

Parameters

Name Type Description
cancel String Caption for the cancel button.
proceed String Caption for the proceed button.
content String Message to show in the dialog.
handler Function Function to call when the proceed button is clicked.

startup(callback)

This method is called to startup the subsystem.

Parameters

Name Type Description
callback Function The function to be called when startup is finished.

shutdown()

This method is called to shutdown the subsystem.

isLoaded()

This method is called to check whether the subsystem has been started.

Returns

Type Description
Boolean true if the subsystem has been started.