Not getting data from AW.XML.Table
I'm just got my V2.0 update, and am trying to update my older grid creation logic using an XML table reading a file from the server.
Based on a V2.0 thread in the forum, I've used the following example code for the test:
If I look at the table right after the dataTable.request();, it contains zero rows. If I wait half a second and look at the table after it's had time to fetch the data, I see 15 rows. If I add gridObj.refresh(); at this point, which I expected to be the last required step, I still see nothing in the grid.
The XML data, from the V1.xx code, looks like this:
for 15 devices. When I run this in Windows XP using Firefox V1.5, I get the following error message in the Firefox JavaScript Console:
The grid I'm testing does display data correctly when loaded from an internal JavaScript array, so the problem seems to be loading data from the AW.XML.Table. This feels like it might be an XML formatting problem to me. Are there any new requirements for formatting XML that I haven't found in the forum yet? Are there any other problems here that I haven't found yet?
Thanks in advance for any help anyone can offer.
JFE.
Based on a V2.0 thread in the forum, I've used the following example code for the test:
var dataTable = new AW.XML.Table;
dataTable.setURL("myfilename");
dataTable.setColumns(["Device", "Status", "Timestamp", "Appr Rate", "Balance"]);
dataTable.request();
var gridObj = new AW.UI.Grid;
gridObj.setColumnCount(5);
gridObj.setHeaderText(["Device", "Status", "Timestamp", "Appr Rate", "Balance"]);
gridObj.setCellModel(dataTable);
document.write(gridObj);
If I look at the table right after the dataTable.request();, it contains zero rows. If I wait half a second and look at the table after it's had time to fetch the data, I see 15 rows. If I add gridObj.refresh(); at this point, which I expected to be the last required step, I still see nothing in the grid.
The XML data, from the V1.xx code, looks like this:
<?xml version="1.0"?>
<ArrayOfDevices xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
<device>
<id>Y5562201</id>
<status>Up</status>
<timestamp>01/01/2006 12:13:15</timestamp>
<approval>57%</approval>
<balance>123456</balance>
</device>
...
</ArrayOfDevices>
for 15 devices. When I run this in Windows XP using Firefox V1.5, I get the following error message in the Firefox JavaScript Console:
Error: uncaught exception: [Exception... "The expression is not a legal expression." code: "51" nsresult: "0x805b0033 (NS_ERROR_DOM_INVALID_EXPRESSION_ERR)" location: "http://localhost:8080/pages/ActiveWidgets/source/lib/xml/table.js Line: 212"]
The grid I'm testing does display data correctly when loaded from an internal JavaScript array, so the problem seems to be loading data from the AW.XML.Table. This feels like it might be an XML formatting problem to me. Are there any new requirements for formatting XML that I haven't found in the forum yet? Are there any other problems here that I haven't found yet?
Thanks in advance for any help anyone can offer.
JFE.
Jack Emmerichs
March 9,