on 12-01-2011 4:33 PM
Hi,
I am using below code to store key value pair using SUP api for offline storage in workflow apps:
SUPStorage.prototype.setItem(j, airlineId);
Example: var j = 1;
var airlineid = "lufthansa";
This works fine, but I want to store an array or at least a structure (single row) which has multiple items. How can we do that?
I tried passing MBO value data directly, but it gives exception while I try to read:
var mvc = getCurrentMessageValueCollection();
var fData = mvc.getData("flightmbo");
var values = fData.getValue();
var i = 1;
SUPStorage.prototype.setItem(i, values);
This does not give any exception, but when I try to read by using code:
var i = 1;
airlineKey = SUPStorage.prototype.key(i);
values = SUPStorage.prototype.getItem(airlineKey);
var j = 0;
var theItems = values[j];
This gives exception saying "Type Error: Result of expression 'values' [null] is not an object".
Any workarounds to store a structure/array with the same key (such as airline id, text, time, availability).
Thanks,
Rohit
Have you tried converting the array/structure to a string using JSON (or some similar technique) and storing it that way?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.