Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 2nd, 2003, 04:42 AM
Registered User
 
Join Date: Dec 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Data Island when it has empty data

Hi there,

i have an application which used RDS. I'm migrating it to use Web-Services and XML. The RDS DataControl DSO has been substituted by a Data Island. The problem occurs when the web-service doesn't return any data. The DataGrid i'm using is from 3rd party, and automatically draws the columns based on the information in the DSO. Unfortunatelly, the XML in the Data Island only has information about the columns in each row. If there is no row, the DataGrid doesn't know what columns exist... There is even another problem, but i would be very glad to solve this one...

I hope i was clear... :)

 
Old December 2nd, 2003, 05:32 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

It's all very vague but perhaps the following suggestions might help.
1) Use the ondatasetcomplete event on the data island to begin showing the data. Check when it fires that you have the necessary data.
2) Have a dummy xml document to use with just enough information to show headers.
3) Why is xml empty? Has the web service failed or is it just because there a re no records matching the criteria?

Joe (MVP - xml)
 
Old December 2nd, 2003, 07:08 AM
Registered User
 
Join Date: Dec 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm sorry for being so vague... I'll try to explain it better now:

Suppose i have this data island:

<xml id="xmlDSO"></xml>

In client-side, i call a Web Service following some criteria. The following xml string is (for example) returned
<root>
    <order>
         <id>aaa</id>
         <name>xpto1</name>
    </order>
    <order>
         <id>bbb</id>
         <name>xpto2</name>
    </order>
</root>

I load the xml string into the XML Data Island, and i have this 3rd party DataGrid (Sheridan) with a data bind to the DSO i created. The Sheridan automatically draws the columns related to the structure, so a 2x2 table is created.

Suppose now that the search criteria was not met. The return xml string would be "<root/>"
The Sheridan won't display the columns (because the Data Island doesn't have information about the fields), and worst of all, it says it has 1 record (probably because of the <root/> tag).

With the RDS Dso, the bind worked normally... Is it possible for the XML Data Island to have information about the fields without any entry on it?

Thanks in advance
 
Old December 2nd, 2003, 10:01 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

So in the previous version a empty result set would show as a two column table but with no records? When you retrieve the web service result check if it is just an empty root element. If it is send a dummy xml string to the island and see if that displays properly.
Example of dummy string:
Code:
<root><order><id/><name/></order></root>
If this still shows as one record I don't know what to do. I have sworn never to use Sheridan stuff after all the hassles we have had with their licensing system :).
It obviously worked with an empty recordset using your old code so you could produce one using the xml but it seems like a lot of work. What advantages does the data grid give you?

Joe (MVP - xml)
 
Old December 2nd, 2003, 10:44 AM
Registered User
 
Join Date: Dec 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much for your atention...

The dummy code you gave returns 1 record in the Sheridan... I had already tested it in my (frustrated) attempts...

>>What advantages does the data grid give you?

None, but our client requires us to use Sheridan. The main reason is probably the use of CTRL to make multiple selections in the table, i don't know. But, as the saying goes, "the client is always right" :P.

I guess i'll test if the xml is empty, if so, create the columns in Sheridan in runtime... It isn't pretty but should work...







Similar Threads
Thread Thread Starter Forum Replies Last Post
data island nerssi Javascript 1 February 14th, 2008 08:47 AM
Data Island Problem musa100 XML 1 August 5th, 2005 01:53 AM
XML Data Island Display Problem marcuslim XML 8 December 7th, 2004 04:00 AM
Data Island vs. XSL? hbcontract XML 9 November 19th, 2003 05:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.