Functions to store results from online requests in a specified cache.
Cached result sets must be stored as strings (before deserialization to an xmlWorkflowMessage structure).
Calls to these methods do not trigger events.
// These constructors create two local storage instances with their own domain var store1 = new hwc.SUPStorage("mydomain"); var store2 = new hwc.SUPStorage("myotherdomain"); // This constructor creates a shared storage instance whose key is the one set in the // packaging tool for generated JavaScript API, or in the Hybrid App Designer. var storeS = new hwc.SharedStorage();
// Displays the current number of elements in the storage var store = new hwc.SUPStorage(); alert(store.length());
// Displays the value at the provided index in the storage var store = new hwc.SUPStorage(); alert(store.key(2));
// Displays the value for the provided key var store = new hwc.SUPStorage(); alert(store.getItem("mykey"));
// Sets a key/value pair var store = new hwc.SUPStorage(); store.setItem("mykey", "myvalue");
// Removes a key/value pair var store = new hwc.SUPStorage(); store.removeItem("mykey");
// Clears the storage var store = new hwc.SUPStorage(); store.clear();