Re: [flexcoders] Populating a tree with E4X notation
Here is the working version :) Regards, Arul ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"mx:Script![CDATA[mx.collections.XMLListCollection;mx.collections.ArrayCollection; [Bindable] public var myData:XML =catalogcategory name="Companies" //catalog;function buildTree():void{/*you have created tags with the name "name" instead creating attribute *///myData.category.name[0]="Nat West PLC";//myData.category.name[0].name[0]="Nat West Reading";[EMAIL PROTECTED]"Nat West PLC";[EMAIL PROTECTED]"Nat West Reading";}]]/mx:Scriptmx:Panelmx:Tree id="prodTree" dataProvider="{myData}" width="200" showRoot="false" labelField="@name" enabled="true" borderStyle="inset"/mx:Button click="buildTree()" label="Build"//mx:Panel/mx:Application - Original Message - From: "jamiebadman" [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, August 22, 2006 6:35 PM Subject: [flexcoders] Populating a tree with E4X notation Hi, Wonder if someone can help... I'm trying to build a basic tree using E4X notation but it's going kinda weird - as you can see if you run the code below, the tree seems to show ok - but it also shows the XML over the top of the tree! I guess I'm doing something quite wrong here - could someone put me on the right track ? (code below) Thanks, Jamie. ?xml version="1.0" encoding="utf-8"? mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" mx:Script ![CDATA[ import mx.collections.XMLListCollection; import mx.collections.ArrayCollection; [Bindable] public var myData:XML = catalog category name="Companies" / /catalog; private function buildTree():void{ myData.category.name[0]="Nat West PLC"; myData.category.name[0].name[0]="Nat West Reading"; } ]] /mx:Script mx:Panel mx:Tree id="prodTree" dataProvider="{myData}" width="200" showRoot="false" labelField="@name" enabled="true" borderStyle="inset"/ mx:Button click="buildTree()" label="Build"/ /mx:Panel /mx:Application __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___ treeTest.mxml Description: Binary data
[flexcoders] Populating a tree with E4X notation
Hi, Wonder if someone can help... I'm trying to build a basic tree using E4X notation but it's going kinda weird - as you can see if you run the code below, the tree seems to show ok - but it also shows the XML over the top of the tree! I guess I'm doing something quite wrong here - could someone put me on the right track ? (code below) Thanks, Jamie. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.collections.XMLListCollection; import mx.collections.ArrayCollection; [Bindable] public var myData:XML = catalog category name=Companies / /catalog; private function buildTree():void{ myData.category.name[0]=Nat West PLC; myData.category.name[0].name[0]=Nat West Reading; } ]] /mx:Script mx:Panel mx:Tree id=prodTree dataProvider={myData} width=200 showRoot=false labelField=@name enabled=true borderStyle=inset/ mx:Button click=buildTree() label=Build/ /mx:Panel /mx:Application -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Populating a tree
Does anyone know of, or have an exmample on how I can populate a tree with a returned query from a cfc. Everything I have tried so far has turned out to not work. any help with this would be greatly appreciated. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Populating a Tree at Runtime with a org.w3c.dom. Document
I played around with this a little today and realized that RemoteObject doesn't support returning a Document class too nicely because the Document implementations (at least the default crimson version) have circular references. This is something we can look to fix in a future updater. In the meantime the question is whether you really want the data represented as XML in the first place. If you are pulling in the data from a database you can simply build a tree of objects and return that to Flex. Flex can take those objects and build a tree out of it as long as you specify the labelField correctly. If you already have XML then I guess what you can do is serialize it into a String, send that across to Flex, then turn that String back into XML using mx.utils.XMLUtil.createXML(). Let me know if this doesn't make sense, Matt -Original Message- From: brian_r_christian [mailto:[EMAIL PROTECTED] Sent: Sunday, May 09, 2004 11:46 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Populating a Tree at Runtime with a org.w3c.dom.Document What I'm trying to do is get a org.w3c.dom.Document from a method of a remote POJO and populate an mx:Tree with its results. How would this work? The POJO method seems to work fine, but we're not sure how to get the returned org.w3c.dom.Document into a format that the Tree will display. Thanks! Brian Christian