{dialog.object}ajaxCallback Method


{dialog.object}.ajaxCallback(part,rowNum,XbasicFunction [,callbackURL [,additionalData [, options]]]);



In a grid component, part indicates the Grid part (Search, Grid, or Detail View) from which data should be submitted. In a UX Component, this parameter is not used and should be an empty string.


In a grid component, row indicates the Grid row from which data should be submitted. In a UX Component, this parameter is not used and should be an empty string.


The name of the Xbasic function you want to call on the server.


Default = "". This parameter is almost always set to a blank string. It can be used to specify the URL you want to call to handle the callback. For example, you could call a .php, or .asp page to handle the callback. If this value is not blank then the setting for XbasicFunction is ignored.


Default = "". Any additional data you want to submit. The data in the controls on the UX Component is automatically submitted. This can be used to submit additional data. Specify a string of name/value pairs. e.g. 'data1=value1&data2=value2'


An object with one or more additional options. Available options include:


A true/false value. If true, form data will be submitted from the component. Set to false if you do not want to submit form data.


Maximum number of milliseconds to wait for a response from the server. If no response is received, an optional errorFunction can be called.


Function called if the server does not send a response. A response may not be sent if there is no internet connection or the server cannot be reached.

If the server does not send a response because there was an error when executing the Xbasic function handling the callback, the error function will not be called. To handle Xbasic errors in your callback functions, add error handling logic to capture the Xbasic error and return an error message to the client.


Function to call if the callback completes successfully.


Function to call if the device is offline.


A true/false value. Indicates if the location (latitude and longitude) should be fetched from the browser and submitted to the server.

The e object passed to ajax callback function will contain the location in the following properties: __locationFound - true/false, __locationLatitude - the latitude value, and __locationLongitude - the longitude value.

Not all browsers support fetching the location.


A true/false value. Indicates if high accuracy should be used when fetching the location. Using high accuracy will take longer and use more power.


Amount of time to wait in milliseconds to fetch the location.


Maximum time in milliseconds to accept a previously fetched location. A value of 0 means that a new location must be fetched.


A true/false value. If true, list data is submitted to the server.


An object with the following properties:


A true/false value. If true, chunked responses will be used.


The maximum number of messages to listen for.


The maximum number of seconds to listen for messages.


Does an Ajax callback to a server.



Data from the UX Component is submitted to the server. It is recommended that you use Action Javascript to write the code for you. This can be done by creating an Ajax Callback Action either as a Javascript Action or as Action Javascript for a control's event.

The method has several blank arguments in order to keep the method prototype the same as for the Grid component.

See Also