the question was not about ability to use hierarchical XML, but what the ...
means in e4x parlance. I just played with this, its a matching syntax
see http://livedocs.adobe.com/flex/201/langref/XML.html
I just changed line 17 of the sample I posted to
leData = event.result..item;
and added a item node below other nodes in my XML posted below
The result in the DG is two rows now. event.result..item matches any item
nodes in your XML. Where as event.result.item matches the nodes at the top
level only.
<?xml version="1.0" encoding="UTF-8"?>
<filter>
<item section="Mission">
<question>Do you like this color?</question>
<response>Y</response>
<tests>
<test>
<item section="fff" >
<question>Do you sdfgsdfglike this color?</question>
<response>Y</response>
</item>
</test>
</tests>
</item>
</filter>
Using XML like you did is no problem. you got a big tree there in that
app. I pushed a app out recently with a large tree, using gzip compression
sped it up considerably.
DK
On 4/26/07, Robert Capilli <[EMAIL PROTECTED]> wrote:
Like this?
I produce an XLS sheet via the DB very much like this with several
different levels. But this is dove with Cold Fusion. Then I send it back
through the RemoteObject like I earlier displayed and then I can use it how
ever I want.
http://www.franticphotos.com/0personal0/flex/bin/main.html
Wait till the LOADING bar finishes and you will see a tree list display.
This is all dove with a multilevel node XML.
If you need to see the code I can give you all access to this as well.
I'm not sure I'm even helping right now J
------------------------------
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Douglas
Knudsen
*Sent:* Thursday, April 26, 2007 3:00 PM
*To:* [email protected]
*Subject:* Re: [AFFUG Discuss] Using XML as a dataProvider
ha, timing!
filterData.lastResult...item
Curious, what if your XML has item nodes at different levels?
DK
On 4/26/07, *Clarke Bishop* <[EMAIL PROTECTED]> wrote:
Thanks Robert!
Precia taught me a new trick that solved my problem:
This does not work:
<mx:XMLListCollection id="xc " source="{filterData.lastResult.filter.item
}"/>
But, this does:
<mx:XMLListCollection id="xc" source=" {filterData.lastResult...item }"/>
This would seem to access the same data. But apparently, AS3 does not like
for you to reference the root node. So, the second syntax works, but the
first one doesn't!
I thought you all might like to know in case you run into this.
Clarke
------------------------------
*From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Robert
Capilli
*Sent:* Thursday, April 26, 2007 1:39 PM
*To:* [email protected]
*Subject:* RE: [AFFUG Discuss] Using XML as a dataProvider
*This is what I do.*
<!-- Gets the site tree to be displayed -->
<mx:RemoteObject id="e4xService" endpoint="
http://apps.eyewonderlabs.com/flex2gateway/" destination="ColdFusion"
source="robert.SiteSpecSystem.CFC.RecursiveSearchForTree"
result="SaveXMLData(event)"/>
<mx:XMLListCollection id="myXMLList" source="{myXML.node}"/>
*Then in my Data Tree I do this..*
<mx:Tree id="myTree"
folderClosedIcon="@Embed(source='images/icon_parent.png')"
folderOpenIcon="@Embed(source='images/icon_parent.png')"
defaultLeafIcon="@Embed(source='images/icon_child.png')"
x="10" y="26" width="100%"
dataProvider="{myXMLList}" labelField="@label"
change="selectNode(event,'Tree')"
height="443"/>
*Notice the labelField. [EMAIL PROTECTED]
* *
*My XML has a attribute called Label.*
* *
*<Employee Label="john smith">*
* *
*This displays the Label within my tree*
* *
*If you need I can send you the file that I do this in and you can see how
it's done. I build my XML file dynamically via the DB. Then I use the XML
file as shown above.*
------------------------------
*From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Clarke
Bishop
*Sent:* Thursday, April 26, 2007 1:20 PM
*To:* [email protected]
*Subject:* [AFFUG Discuss] Using XML as a dataProvider
I am trying to use XML (e4x format) as a dataProvider.
1. I load the XML via an HTTPService call that is triggered by the
CreationComplete event that calls my init() method.
<mx:HTTPService id=" filterData" url="ModelData/FilterData.xml"
result="xmlResult()" resultFormat="e4x" />
2. The XML data comes back. I can see it with the debugger in lastResult.
3. I'm trying to assign the filterData XML to an XMLListCollection like
this:
<mx:XMLListCollection id="xc " source="{filterData.lastResult.filter.item
}"/>
I know the dataGrid is supposed to automatically convert an XMLList to an
XMLListCollection, but since it's not working, I thought I could understand
it better by doing it manually.
The problem is that even though the XML data is there, the
XMLListCollection stays blank. What am I missing?
By the way, here's an example of my external XML file:
<?xml version= "1.0" encoding= "UTF-8"?>
< filter>
<item section= "Mission">
< question> Do you like this color?</question >
<response >Y </response>
</ item>
</ filter>
Thanks for any ideas!
Clarke
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------
--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------
--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the
subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------