Utility Functions Follow
In app Visualizer there is JavaScript section in which the user can write any JS native code.
In addition there are utility functions that are implemented on AuraPlayer's default libraries.
Those functions appear in the JS auto complete.
clearTextFields()
Clear textarea and [type=text] fields.
clearInputFields()
Clear [type=input] fields.
populateField(fieldName, fieldValue, fieldPostfix)
Set value of an input field, also storing it at session data.
populateFieldHTML(fieldName, fieldValue, fieldPostfix)
Set value of an input field.
getFieldValue(key)
Get value of a field.
getSessionFieldValue(key)
Get value from session storage.
getResponseNodeValueByName(nodeName)
Get value of response node.
getResponseNodeListValueByName(nodeName)
Get value of response list.
getLocation(callback)
Get details of current GPS location and pass results to a callback function.
Result example: {street_number: 12, route: Rambam Street, locality: Tel Aviv, administrative_area_level_1: Tel Aviv District, country: Israel}
populatePosition(callback, position)
Get details of location specified by position, and pass results to a callback function.
position - composed of position.coords.latitude and position.coords.longitude.
callWebServiceWithAllParams(webService, initHandler, responseHandler, failureHandler, asyncFlag, populateFields)
Execute a service.
webService - name of a service.
initHandler - function to be called before executing the service (initHandler(serviceName))
responseHandler - function to be called on successful service response (responseHandler(response, serviceName, status))
failureHandler - function to be called on service failure.
navigate(targetUrl)
Navigate to other url or page.
targetUrl - url or filename of another page.
createList(serviceName, listItemTitle, selectionHandler)
Query a service, and populate list with the result.
serviceName - name of the service.
listItemTitle - Either
(A) name of output field whose value will be used for list-item title; OR
(B) function(outputParams, index) - outputParams - object containing selected item output params, index - index of item in list. Returns title for a list item in list.
selectionHandler - function(outputParams) - callback function for an element pressed. outputParams - object containing selected item output params (default: defaultListSelectionHandler).
createSelect(serviceName, fieldID, onChangeFunc, defaultIndex)
Query a service, and populate object with the result.
serviceName - name of the service.
fieldID - name of an output field in which the select would be populated into.
onChangeFunc - (optional) onchange callback function.
defaultIndex - (optional) index to be selected (default: 0).
deleteOfflineResponse(serviceName)
Delete cached response of a given service.
deleteAllOfflineResponses()
Delete any cached responses.
killSession()
Kill the sessionId stored in sessionStorage, and invalidate it in sessionStorage.
killSession(sessionId)
Kill the given sessionId, and invalidate it in sessionStorage if the given value is set.
showInfoPopup(title, message, confirmCallback)
Show dialog with single OK button.
title - popup window title.
message - popup contents.
confirmCallback - (optional) function to be called once the OK button is clicked.
showConfirmPopup(title, message, confirmCallback, cancelCallback)
Show dialog with OK and Cancel buttons.
title - popup window title.
message - popup contents.
confirmCallback - (optional) function to be called once the OK button is clicked.
cancelCallback - (optional) function to be called once the Cancel button is clicked.
store(fieldName, fieldValue)
Store value in session storage.
storeFromIndex(fieldName, index)
Store value in session storage.
The value to be set will be evaluated from the session storage variable having the specified index.
For example: having fieldName=S_ORDER_ID_0 and index=4,
the function stores the value of S_ORDER_ID_4 to S_ORDER_ID_0.
removeItem(key)
Remove value from session storage.
removeItemNameContains(keyName)
Remove all values from session storage, whose keys contains the specified substring.
cleanValue(val)
Trim value from leading and tailing spaces.
Returns empty string if value does not exists.
Comments
0 comments
Please sign in to leave a comment.