It is easiest to learn how to call the Hybrid Web container by examining the API.js and Utils.js files that the Mobile Workflow Forms editor generates.
if (isWindowsMobile()) { var xmlhttp = getXMLHTTPRequest(); xmlhttp.open("POST", "/sup.amp?querytype=setscreentitle&version=2.0", false); xmlhttp.send("title=" + encodeURIComponent(screenTitle)); } else if (isIOS()) { var xmlHttpReq = getXMLHTTPRequest(); xmlHttpReq.open("GET", "http://localhost/sup.amp?querytype=setscreentitle&version=2.0&title=" + encodeURIComponent(screenTitle), true); xmlHttpReq.send(""); } else if (isAndroid()) { var request = "http://localhost/sup.amp?querytype=setscreentitle&version=2.0&title=" + encodeURIComponent(screenTitle); _WorkflowContainer.getData(request); } else { //must be BlackBerry var xmlhttp = getXMLHTTPRequest(); xmlhttp.open("POST", "http://localhost/sup.amp?querytype=setscreentitle&version=2.0", false); xmlhttp.send("title=" + encodeURIComponent(screenTitle)); }
Sets the native screen title on the Web Container.
Closes the native Web Container (Windows Mobile only).
Adds a single menu item to the Web Container.
Removes all the menu items from the Web Container.
Clears the entire Online Request cache for the current Mobile Workflow application.
Clears a single Online Request cache entry for the current Mobile Workflow application.
Logs a message to the AMPHostLog.txt (mocalog.txt for iOS) on the device. This log file can be retrieved remotely from Sybase Control Center.
Shows a native platform certificate picker on the device for selecting certificate credentials.
On iOS, this function shows the URL in the Workflow Container in a separate browser instance. On all other platforms, this launches the native Web browser in another window with the given URL.
Using third party file viewers, this function displays an attachment that has previously been downloaded using the downloadattachment querytype in a separate window.
Using third party file viewers, this function displays an attachment that was included as part of the Workflow .zip package, in a separate window.
This function executes an online request to the Unwired Server synchronously, in other words, a network connection must be available. This can indicate results should be cached for future access (in which case a network connection does not need to be available).
Requests an attachment to be downloaded from the Unwired Server through an object query. A network connection is required for this operation. This operation occurs asynchronously, and the calling JavaScript is notified when it is complete.
Submits the current MessageValueCollection to the Unwired Server for processing by the server plug-in. This operation occurs asynchronously. If a network connection is not available when this operation is performed, the request is queued up and executed the next time a network connection is available.
Shows a message box in native code (iOS and Android platforms only).
Requests the Web Container for the transform data (the contents of the e-mail message) for the current Workflow message.
Instructs the Web Container to add the supplied list of menu items.
Notifies the Container that a screen navigation is occurring, and to update credentials in the credentials cache, if required.