mobile.lib.Form
Properties
id
This is the unique id for the form (not unique between instances of the same form).
Example: “54015330-4ce4-4346-8d0a-1ff92bfb5c99”
path
This is the path to the form.
Example: “MyFirstModule/EmployeeOverview_mobile.mxf”
title
The title of the form, as defined in the Modeler.
context
The current context of the form.
domNode
A reference to the form’s dom node.
Methods
startup()
This method is called to startup the form, and parse widgets in it.
show()
This method is called to show the form.
hide()
This method is called to hide the form.
getChildren(nested)
This method is called to get the top or all child widgets in the form.
Parameters
Name | Type | Description |
---|---|---|
nested | Boolean | Whether all or just the top child widgets should be returned. |
getTitle()
Return the title of the form.
Returns
Type | Description |
---|---|
String | The title of the form. |
setTitle(title)
Set the title of the form.
Parameters
Type | Description |
---|---|
String | The new title of the form. |
callRecursive(method, …)
This method is called to invoke a function on all top widgets.
Parameters
Name | Type | Description |
---|---|---|
method | String | Method to invoke on all top widgets. |
… | Mixed | Parameters to call the method with. |
suspend()
This method is called to put all child widgets in suspended state.
resume()
This method is called to put all child widgets in active state.
enable()
This method is called to put all child widgets in enabled state.
disable()
This method is called to put all child widgets in disabled state.
save(callback)
This method is called to save the content of the form.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | Function to call when finished. |
commit(callback)
This method is called to commit the content of the form.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | Function to call when finished. |
rollback(callback)
This method is called to rollback the content of the form.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | Function to call when finished. |
listen(message, callback)
This method is called to register a listener to a given message.
Parameters
Name | Type | Description |
---|---|---|
message | String | The message to listen to; one of “save”, “commit” or “rollback”. |
callback | Function | Function to call when the message is published. |
Returns
Type | Description |
---|---|
Array | The handler to remove the subscription with. |
unlisten(handler)
This method is called to unregister a listeners to a given message.
Parameters
Name | Type | Description |
---|---|---|
handler | Array | The return value of the call to the listen method. |
applyContext(context, callback)
This method is called to apply a context to the content of the form.
Parameters
Name | Type | Description |
---|---|---|
context | mendix.lib.MxContext | The context to apply. |
callback | Function | Function to call when finished. |
destroy()
This method is called to destroy the content of the form.
Events
onBeforeShow()
Called before the form is shown.
onBeforeHide()
Called before the form is hidden.
onAfterShow()
Called after the form is shown.
onAfterHide()
Called after the form is hidden.