3.2.0

Trouble with SetXML

Can someone tell me what is wrong with the following example? The grid gets rendered but not the data. Is this the proper way of using SetXML?

Thanks.

Ken


<html>
<head>
<link href="ActiveWidgets/runtime/styles/xp/aw.css" rel="stylesheet"></link>
<script src="ActiveWidgets/runtime/lib/aw.js"></script>

</head>

<body>
<script>


var myXML = '<Sports xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' +
'<eOrder>' +
'<Ordernum>6</Ordernum>' +
'<CustNum>1</CustNum>' +
'<OrderDate>2006-02-11</OrderDate>' +
'<ShipDate>2006-02-16</ShipDate>' +
'<PromiseDate>2006-02-16</PromiseDate>' +
'</eOrder>' +
'</Sports>';

var table = new AW.XML.Table;
table.setXML(myXML);


var obj = new AW.UI.Grid;
obj.setColumnCount(5);
obj.setCellModel(table);

document.write(obj);


</script>
</body>
</html>
Ken
April 5,
A rowcount line is needed:
you can use either:
obj.seRowCount(1);
or:
obj.setRowCount(table.getCount());
April 6,
Yes, setRowCount() is necessary because in the case of XML data islands (or when you just use setXML method) the response() callback does not run and does not set row count on the grid.
Alex (ActiveWidgets)
April 6,

This topic is archived.

See also:


Back to support forum