I'll give +1 to Alex Cheng since he info lead me to the solution.
This is how I solved my problem..
My JSONExtractor class...
private String setupCacheTabData()
{
JSONArray jsonList = new JSONArray();
List<IDataDelivery> cacheDeliveryRecords = service.getCacheDeliveryRecords();
for (IDataDelivery cache : cacheDeliveryRecords)
{
JSONObject jsonO = new JSONObject();
try
{
jsonO.put("cacheID", cache.getCacheID());
jsonO.put("cacheversion", cache.getVersion());
jsonList.put(jsonO);
}
catch (Exception e)
{
log.error("Error decoding CACHE database row for JSON (WILL SKIP): CACH_ID=" + cache.getCacheID(), e);
}
}
return jsonList.toString().replace("\"", "'");
}
My Javascrip code...
var cacheInfo;
var rawdataCacheInfo = <s:property value='%{cacheString}'/>;
cacheInfo = new dojo.data.ItemFileWriteStore({
data: {
identifier: 'cacheId',
label: 'cacheId',
items: rawdataCacheInfo
}
});
function do() {
var xhrArgs = {
url: "../secure/jsonServlet?class=JSONExtractor&startDate="+startDateValue+"&startTime="+startTimeValue,
handleAs: "json",
preventCache: true,
load: function(data) {
// remove items...
var allData = cacheInfo._arrayOfAllItems;
for (i=0;i<allData.length;i++) {
if (allData[i] != null) {
cacheInfo.deleteItem(allData[i]);
}
}
// save removal of items.
ddInfo.save();
// add new items
for (i=0;i<data.length;i++) {
cacheInfo.newItem(data[i]);
}
},
error: function(error) {
}
}
}