interface jQuery.sap.storage.Storage

Visiblity: public
Available since: N/A
Module: jquery.sap.storage
Application Component: CA-UI5-COR

A Storage API for JavaScript.

Provides methods to store data on the client using Web Storage API support by the browser. The data received by this API must be already serialized, in string format. Similarly, the API returns the retrieved data in serialized string format, so it is the responsibility of the caller to de-serialize it, if applicable.

Attention: The Web Storage API stores the data on the client. Therefore do not use this API for confidential information.

One can get access to the 'default' storage by using jQuery.sap.storage directly or alternatively via factory functionality available as jQuery.sap.storage(jQuery.sap.storage.Type.session) returning an object implementing this interface.

A typical intended usage of this API is the storage of a string representing the state of a control. In such usage, the data is stored in the browser session, and the methods to be used are #put and #get. The method #remove can be used to delete the previously saved state.

In sake of completeness, the method #clear is available. However, it should be called only in very particular situations, when a global erasing of data is required. If only keys with certain prefix should be deleted the method #removeAll should be used.


Events Overview

Event Description