all groups > flash data integration > june 2007 >
You're in the

flash data integration

group:

DataSets, DataGrid, XML Oh My


DataSets, DataGrid, XML Oh My truly_great
6/11/2007 2:59:42 AM
flash data integration: OK -= I am sure everyone is tired of hearing about everyone else's problems
with data binding, but here is another one:)

I am using the Component Inspector to bind my XML Connector, DataSet, and
DataGrid. No matter how many times I try it, all I get is a grid with column
names.

So, what I need to know is how many bindings XML to dataSet, and dataSet to
dataGrid,.

I have tried it MANY differnet ways, but currently, I have:

XML to dataSet: dataProvider to the resu;lts Schema Array, dataProvider to the
paramater schema array, and SelectedIndex to dataSet.

dataSet to dataGrid: dataProvider and SelectedIndex.

When I open the SWF, it shows a grid with column names and no data. If I click
on a column I get an error that reads:

Property 'Location' (or any column name) not found in schema for dataSet
'cs_ds' can't build index.

My XML is as follows:

<?xml version="1.0" encoding="iso-8859-1"?>
<Summary>
<CallRow>
<Call>#Q500COG30</Call>
<Priority>3</Priority>
<Type>1182</Type>
<Group>PD</Group>
<Area>512</Area>
<Unit></Unit>
<From>07:10</From>
<To></To>
<Location>Datadata</Location>
</CallRow>
<CallRow>
<Call>#Q500CO232</Call>
<Priority>3</Priority>
<Type>415M</Type>
<Group>PD</Group>
<Area>112</Area>
<Unit>1A35</Unit>
<From>07:11</From>
<To></To>
<Location>datadata</Location>
</CallRow>
<CallRow>
<Call>#Q500COO32</Call>
<Priority>3</Priority>
<Type>459C</Type>
<Group>PD</Group>
<Area>582A</Area>
<Unit>312</Unit>
<From>07:11</From>
<To></To>
<Location>DATADATA</Location>
</CallRow>
</Summary>

Any ideas???

TIA

Thia
Re: DataSets, DataGrid, XML Oh My conquerors04
6/12/2007 7:13:47 PM
I may need to catch up to you a bit, but try this, if you have binded to the
CallRow Atribute in the XML Connector then in the results listener, print out
[yourDataSet].items[0].Call and you should get your first value...

Make sure your bind to your dataGrid is from dataProvider to dataProvider of
the DataSet. Also make sure if you are trying to bind within a movie and not
on a screen, that the bind is happening in the first frame of your movie or
scene.

If all that is fine, then you can use a cellRenderer to array the data into
your DataGrid as such:

datagrid.getColumnAt(0).cellRender = "cellRendererScript";

Do you know how to do a cellRenderer script, if not reply and say so and I'll
add it.

Re: DataSets, DataGrid, XML Oh My truly_great
6/13/2007 4:08:47 PM
Re: DataSets, DataGrid, XML Oh My wizbang
6/28/2007 8:59:32 PM
I am having similar problems and I think I can reduce the problem a little more
basically,

Conider the tutorial from Macromedia,
http://livedocs.macromedia.com/flash/8/main/00000354.html which uses the XML
file,

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<datapacket>
<row act="10" custId="0" date="05/12/2002" billable="true" duration="3"
id="1" notes="Here is note(1)" projId="1" rate="45.50" servId="0"/>
<row act="9" custId="0" date="05/13/2002" billable="true" duration="8.25"
id="2" notes="Here is note(2)" projId="1" rate="45.50" servId="1"/>
<row act="8" custId="0" date="05/14/2002" billable="false" duration="7.75"
id="3" notes="Here is note(3)" projId="1" rate="45.50" servId="1"/>
<row act="7" custId="0" date="05/15/2002" billable="false" duration="6.5"
id="4" notes="Here is note(4)" projId="1" rate="45.50" servId="2"/>
<row act="6" custId="0" date="05/16/2002" billable="false" duration="5.5"
id="5" notes="Here is note(5)" projId="1" rate="45.50" servId="2"/>
</datapacket>

The tutorial carefully steps you through the process of creating the Bindings
and the Schema in all three components. But now I'd like to try my own XML
file and DataGrid, but my XML file is a little different. Here is a sample of
what I am looking at,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ROOT SYSTEM "CountrySample.dtd">
<ROOT>
<row>
<field name="Code">AFG</field>
<field name="Name">Afghanistan</field>
<field name="Continent">Asia</field>
</row>
<row>
<field name="Code">NLD</field>
<field name="Name">Netherlands</field>
<field name="Continent">Europe</field>
</row>
<row>
<field name="Code">ANT</field>
<field name="Name">Netherlands Antilles</field>
<field name="Continent">North America</field>
</row>
<row>
<field name="Code">ALB</field>
<field name="Name">Albania</field>
<field name="Continent">Europe</field>
</row>
<row>
<field name="Code">DZA</field>
<field name="Name">Algeria</field>
<field name="Continent">Africa</field>
</row>
</ROOT>

In the Macromedia tutorial, the data are attributes in the row element and the
field names are the attribute names. In my example the child element is the
field and the field name is the attribute "name".

I can find no documentation to help make the transition from the demonstrated
XML to this other schema. I haven't the slightest idea what to do.

How do you apply the Component Inspector and the Properties windows for
XMLConnector, DataSet and DataGrid to display this data in the DataGrid?

AddThis Social Bookmark Button