3.2.0

Having Problem posting data from a service

Hi,
I use
var table = new AW.XML.Table;
table.setURL("webservice.asmx/getDataSet");
table.setParameter("name", "value");
table.setRequestMethod("POST");
table.setRows("//NewDataSet/*");
table.request();

Grid populates fine, but for fields with dbNull, aw skips the cell, resulting in data shifting to the left.
Hence, my data for each row do not lineup under the correct column header.
Any help?

I am also new, and I don't know how I get informed if someone posts a response! So, wish me luck.
Ghalib
December 13,
>> for fields with dbNull, aw skips the cell

That happen when the element is missing from the XML. In this case you should explicitly specify XPath for each column, for example,

table.setColumns(["@id", "product", "price", "price/@ccy", "qty"]);

http://www.activewidgets.com/aw.xml.table/columns.html

There is also a sample code for this in
/examples/grid data - xml data islands/xpath.htm

>> my data for each row do not lineup

If you are using DOCTYPE which triggers 'standards-compliant' mode and you added borders to the grid cell - you have to compensate the cell size by reducing the cell padding:

#myGrid .aw-grid-row {border-bottom: 1px solid threedlightshadow;}
#myGrid .aw-grid-cell {border-right: 1px solid threedlightshadow;}

/* box model fix for strict doctypes, safari */
.aw-strict #myGrid .aw-grid-cell {padding-right: 3px;}
.aw-strict #myGrid .aw-grid-row {padding-bottom: 3px;}


Alex (ActiveWidgets)
December 13,
Hi Alex,
By "my data for each row do not lineup", I mean is that, as a result of missing cells, since the cell is missing the value,the cell in the next column is shifted to the left. Say, for example, my dataType (column) is date, yet I see dates in some rows and text in other rows under the same column. They all should have been dates.

I also do not understand your explaination. Are you saying that if my data for some fields in a record in my database is blank (dbNull), then I cannot use webServices and I should use a different method?
Are you saying I should not use the following:
table.setURL("webservice.asmx/getDataSet");
thanks
ghalib
December 13,

This topic is archived.

See also:


Back to support forum