This function gets the value corresponding to the given key.
If there is no item with the given key, then the success callback is invoked with null as the parameter.
getItem( key, successCallback, errorCallback )
Name | Type | Description |
key | String | The key of the item for which to get the value.If null or undefined is passed, "null" is used. |
successCallback | sap.EncryptedStorage~getItemSuccessCallback | If successful, the successCallback is invoked with the value as the parameter (or null if the key did not exist). |
errorCallback | sap.EncryptedStorage~errorCallback | If there is an error, the errorCallback is invoked with an ErrorInfo object as the parameter. |
var store = new sap.EncryptedStorage("storeName", "storePassword"); var successCallback = function(value) { alert("Value is " + value); } var errorCallback = function(error) { alert("An error occurred: " + JSON.stringify(error)); } store.getItem("theKey", successCallback, errorCallback);