Mendix Client 4 API Documentation


mxui.wm.Screen

The mxui.wm.Screen subsystem provides an API to manage the content in the three different targets.

Methods

hasLayout()

This method is called to check whether the client resizes every screen to fit the viewport.

Returns

Type Description
Boolean Whether the dimensions are calculated.

reloadContent()

This method is called to invoke the reload method of every top level widget.

resizeContent(args)

This method is called to resize the content of a target. The target is deduced from the specified widget.

Parameters

Name Type Description
args.widget Widget The widget for which to resize the surrounding content.

disposeContent(args)

This method is called to dispose the content of a target. The target is deduced from the specified widget.

Parameters

Name Type Description
args.widget Widget The widget for which to dispose the surrounding content.

suspendContent(args)

This method is called to suspend the content of a target. The target is deduced from the specified widget.

Parameters

Name Type Description
args.widget Widget The widget for which to suspend the surrounding content.

Examples

mx.screen.suspendContent({
    widget : this
});

resumeContent(args)

This method is called to resume the content of a target. The target is deduced from the specified widget.

Parameters

Name Type Description
args.widget Widget The widget for which to resume the surrounding content.

getTitle()

This method is called to get the title of a target. The target is deduced from the specified widget. mxui.widget._Widget.getTitle is an alias for this method.

Parameters

Name Type Description
args.widget Widget The widget for which to get the title.

getUIPlace()

This method is called to get the ui place of a target. The target is deduced from the specified widget. mxui.widget._Widget.getUIPlace is an alias for this method.

Parameters

Name Type Description
args.widget Widget The widget for which to get the ui place.

applyToNode(action, node, handler)

This method is called to apply an action to a node. The action could be one of “show”, “hide”, “disable”, “enable”, “custom”. If the specified node is the domNode of a widget, the widget’s api methods are used instead of DOM manipulation.

Parameters

Name Type Description
action String The action to execute on the node or widget.
node DOMNode The node on which to trigger the action.
handler Function Optional handler which is used if action is “custom”.

Examples

mx.screen.applyToNode("hide", domNode); // will hide the node,
                                        // or if node is the domNode of a
                                        // widget, invoke widget's hide
                                        // method

applyToNodes(args)

This method is called to apply an action to a list of nodes. See applyToNode for more information.

Parameters

Name Type Description
args.content_id String The content id of the surrounding content.
args.mxids Array The mxid’s of the nodes to apply the action to.
args.action String The action to execute on the nodes or widgets.
args.node DOMNode Optional node to narrow the scope in which is searched for the nodes.
args.handler Function Optional handler to use when action is “custom”.

back()

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

forward()

This method is called to go one step forward in the history.

refresh()

This method is called to refresh the current form in content.

setContent(args)

This method is called to set the content of a specified target.

Parameters

Name Type _.Description
args.targeturl String The url of the form to open.
args.targetparams Object The parameters to add to newly created widgets.
args.targetparams.mxcontext MxContext Optional context to open the form with.
args.uilocation String Target in which to open the form (popup/modal/content).

subscribe(contentid, message, callback)

This method is called to subscribe to a screen message (like saveObject / commitObject).

Parameters

Name Type Description
contentid String The id of the content to get messages from.
message String The message on which to subscribe.
callback Function A function to handle the message.

Returns

Type Description
Array Handler to unsubscribe (see unsubscribe.

unsubscribe(handler)

This method is called to unsubscribe from a screen messages.

Parameters

Name Type Description
handler Array Handler which is the return value of the subscribe call.

Returns

Type Description
Array Handler to unsubscribe (see unsubscribe.

sendMessage(contentid, message, args)

This method is called to send a screen message to all listeners (subscribed on this particular message with subscribe).

Parameters

Name Type Description
contentid String The id of the content to get messages from.
message String The message to send.
args Function The arguments to call the listeners with.

Returns

Type Description
dojo.Deferred A deferred on which error and callback functions can be added. See dojo.Deferred documentation.

showLogin()

This method is called to show the login form. Do not manually call this method.

Parameters

Name Type Description
contentid String The id of the content to get messages from.
message String The message to send.
args Function The arguments to call the listeners with.

Returns

Type Description
dojo.Deferred A deferred on which error and callback functions can be added. See dojo.Deferred documentation.

hideLogin()

This method is called to hide the login form. Do not manually call this method.

logout()

Redirect user to login form. Do not manually call this method.

showNavigator()

Show the Navigator.

showNavigator()

Hide the Navigator.

showProgress()

Show the loading icon.

hideProgress()

Hide the loading icon.

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.