You are not Logged in
Would you like to Login or Register

Today is: Friday, 21 November, 2008
Check this months hot topics

Using a DataSet as a return type on an Atlas Javascript WebService call

If the WebService you are calling returns a DataSet it may not be obvious how to get to the data in the returned object.

Here is a little example which may help you on your way..

<script language="javascript">
//<!--
function GetNuugget_OnRequestComplete(result)
{
    var resultsT = result[0];
    var resultRowCount = resultsT.get_length();

    for (var i = 0; i < resultRowCount; i++){
        alert(resultsT.getItem(0).getProperty("Detail"));
        alert(resultsT.getItem(0).getProperty("Creator"));
    }
    
}
//-->
</script>

Notice the DataSet is an array of Table objects. Use the .getItem(rowIndex) method to return the row and the .getProperty(columnName | columnIndex) to access your data.

kick it on DotNetKicks.com del.icio.us digg Mister Wong YahooMyWeb Reddit Furl Spurl blogmarks
Paul Hayman Skype
Author : Paul Hayman
Published : Friday, 14 July, 2006

Paul is the COO of kwiboo ltd consultant and has more than a decade of IT consultancy experience. He has consulted for a number of blue chip companies and has been exposed to the folowing sectors: Utilities, Telecommunications, Insurance, Media, Investment Banking, Leisure, Legal, CRM, Pharmaceuticals, Interactive Gaming, Mobile Communications, Online Services. Paul is the COO and co-founder of kwiboo (http://www.kwiboo.com/) and is also the creator of GeekZilla.

Comments

Pablo said:

Thanks for the code!

but it didnt worked for me exactly as in your post, i needed to use:

resultsT.getRow(0).getProperty("ID")

Maybe my Atlas version... dont know

January 17, 2007 - 5:31 PM

Add Comment

Enter your comment below and it will be submitted for moderation.

Your Name

Add Tag

Please enter tags for this article, seperated by semi-colon ;

View Tag's by : # articles | # views