Bookmark and Refresh API

Generally, app users access certain pages of a Desktop Web application more frequently than other pages. As a result, app users would want to bookmark a page to access it easily.

Quantum Visualizer provides the Bookmark and Refresh API for Desktop Web apps, which enables the developer to add some context information to the URL. Using the context added to URL, the app user is taken to the appropriate page of the application instead of always redirecting to the home page. When the app user bookmarks or shares a page, the URL carries necessary parameters to render the application accordingly.

An example of the URL in the Desktop web application built on Quantum Visualizer would be:

http://xyz.kony.com/kdw/#frm1

The Bookmark and Refresh API uses kony.application namespace and the following API elements.

Function Description
kony.application.addBMState

Adds a specified key and value to the parameter list of the URL of the form.

kony.application.getBMState Retrieves the list of parameters attached to a URL using the above add, set APIs.
kony.application.removeBMState Removes a specified key from the parameter list of the URL of the form.
kony.application.resetBMState Resets the state associated with the URL of a form.
kony.application.setBMState Sets the bookmark state to the URL.
 

Add the specified key value pairs to the application URL by using the kony.application.addBMState function. To add a JSON object containing key value pairs, use the kony.application.setBMState function. Once the context information is added to the URL, you can store the information in the browser.

You can then retrieve the key value pairs by using the kony.application.getBMState function.

If you want to delete the key value pairs from the URL, use the kony.application.removeBMState function. To remove the JSON object containing the key value pairs, use the kony.application.resetBMState function.

To view the functionality of the Bookmark and Refresh API in action, download the sample application from the link below. Once the application is downloaded, build and preview the application using the Quantum App.