3.0.0

WebService Xml Binding to Grid

Hi,
I am guessing that there is a sample to bind XML retuned by Web Service (.NET) call. Could anyone point me to correct sample code or tell me where am I going wrong in the following code. I have verified that the XML retuned by the Web Service is valid. I have checked by savin the XML retuned by the Web Service in a file and the poiting setURL to that file; it works fine in that case. But when I change the setURL to point to the Web Service, the grid is blank.

var table = new AW.XML.Table;

// provide data URL
table.setURL("XmlSource.asmx/getCompanies");

table.setRequestMethod("POST");

// start asyncronous data retrieval
table.request();

table.response = function(text){
alert(text.xml);
obj.setCellModel(table);
obj.refresh();
}
var obj = new AW.UI.Grid;
obj.setColumnCount(6);
document.write(obj);

Thanks,
Pushpendu
Pushpendu
July 25,
Following code did it for me. The post at http://www.activewidgets.com/javascript.forum.10863.5/alex-please-look-xmlhttp-js.html pointed me in the proper direction.

<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<script src="ActiveWidgets/runtime/lib/aw.js">
</script>
<link href="ActiveWidgets/runtime/styles/xp/aw.css" rel="stylesheet"></link>

</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<script>
var table=new AW.XML.Table;
table.setURL("XmlSource.asmx/getCompanies");
table.setRequestMethod("POST");

table.request();

table.response = function(text)
{
var obj = new AW.UI.Grid;

table.setXML(text.xml);

obj.setColumnCount(5);
obj.setRowCount(table.getCount());
obj.setCellModel(table);
parentDIV.innerHTML = obj;
}
</script>

<div id="parentDIV"></div>

</form>

</body>
</html>
Pushpendu
July 28,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.