mendix.sys.Server
The mendix.sys.Server
subsystem provides an API to handle server communication.
Methods
request(args)
This method is called to fire a request to the server. To fetch objects or invoke microflows, mx.data.get or mx.data.action should be used instead.
Parameters
Name | Type | Description |
---|---|---|
args.request.action | String | The action to trigger on the server. |
args.options.unique | Boolean | Whether this request may be merged with an already sent request with the exact same parameters. |
args.options.preventCache | Boolean | Prevent that the response comes from the browser cache. |
args.options.caller | Object | The caller instance, on which server instructions can be executed. |
args.options.handle | Function | Function to handle the result. |
args.options.error | Function | Function to handle errors. |
args.options.callback | Function | Function to handle the result when successfull. |
args.options.sync | Boolean | Whether the request should be synchronous or asynchronous. |
args.options.asyncid | String | Id for this request to ping the server. |
args.options.onValidation | Function | Function to handle validation feedback. |
args.options.standalone | Boolean | If changes may be sent to the server before executing this action. |
get(args)
This method is called to fetch a resource from the server. This adds basic connection error handling to dojo.xhrGet
. To get a form, mx.config.getForm should be used instead.
Parameters
Name | Type | Description |
---|---|---|
args.url | String | The url from which to fetch the resource. |
args.load | Function | Function to handle the result. |
args.error | Function | Function to handle errors. |
args.handleAs | String | How to handle the result (text/json/xml). |
For more parameters, see dojo.xhrGet documentation.
getCacheBust()
This method is called to get the cache bust, used to refetch assets after a redeployment.
Returns
Type | Description |
---|---|
String | The cache bust to append to an url. |
startup(callback)
This method is called to startup the subsystem when a user logs in.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | The function to be called when startup is finished. |
shutdown()
This method is called to shutdown the subsystem when a user logs out.
isLoaded()
This method is called to check whether the subsystem has been started.
Returns
Type | Description |
---|---|
Boolean | true if the subsystem has been started. |