Write an XML from Flex tree values

Hi,
Greetings!!!
I jus need to get the values of dynamically created tree
component as an XML file or values to be populated in text area as
XML format.

Currently When i select a node and Click on Generate XML
button .. the textarea displays the selected node as XML in the
Textarea. But my requirement is to get the complete tree structure
as XML on Click on "Generate XML button" Can u pls provide me some
sample on the same!!!!!
here goes the code!!!
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#333333, #0A0A0A]"
color="#FFFFFF" creationComplete="init(), showAlert('Red');">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.styles.StyleManager;
import mx.effects.easing.Bounce;
import mx.collections.ICollectionView;
import mx.events.ListEvent;
private var alert:Alert;
private var alertCSS:CSSStyleDeclaration;
private function init():void {
alertCSS = StyleManager.getStyleDeclaration("Alert");
private function showAlert(color:Object):void
alertCSS.setStyle("modalTransparencyColor", color);
alertCSS.setStyle("themeColor", color);
private function tree_itemClick(evt:ListEvent):void {
var item:Object = Tree(evt.currentTarget).selectedItem;
if (xmlBound2Tree.dataDescriptor.isBranch(item)) {
xmlBound2Tree.expandItem(item,
!xmlBound2Tree.isItemOpen(item), true);
[Bindable]
private var dataX:XML =<item
label="Parent"></item>;
private function addEmptyBranchDP():void
var dataX:XML = <item label={Eparent.text}
isBranch="true"></item>;
xmlBound2Tree.dataProvider.addItemAt(dataX,0);
private function addEmptyBranchDD():void
var dataX:XML = XML(xmlBound2Tree.selectedItem);
if( dataX == null ) return;
var select:int = xmlBound2Tree.selectedIndex;
if (select == -1)
Alert.show("Please select the Node" , 'Message');
else
var newNode:XML = <item label={Eparent.text}
isBranch="true"></item>;
xmlBound2Tree.dataDescriptor.addChildAt(dataX, newNode,
select,dataX);
xmlBound2Tree.expandItem(xmlBound2Tree.selectedItem,true);
private function addEmptyChild():void
var dataX:XML = XML(xmlBound2Tree.selectedItem);
if( dataX == null ) return;
var select:int = xmlBound2Tree.selectedIndex;
if (select == -1)
Alert.show("Please select the Node", 'Message');
else
var newNode:XML = <item label={Eparent.text}
isBranch="false"></item>;
xmlBound2Tree.dataDescriptor.addChildAt(dataX, newNode,
select,dataX);
xmlBound2Tree.expandChildrenOf(xmlBound2Tree.selectedItem,
true);
private function removeEmployee():void
var node:XML = XML(xmlBound2Tree.selectedItem);
if( node == null )
return ;
if(node.parent()== null)
var select:int= xmlBound2Tree.selectedIndex;
if (select == -1)
return;
else
xmlBound2Tree.dataProvider.removeItemAt(select);
else
var children:XMLList = XMLList(node.parent()).children();
for(var i:Number=0; i < children.length(); i++)
if( children
.@label == node.@label ) {
delete children;
private function gen_xml():void
var node:XML = XML(xmlBound2Tree.selectedItem);
textarea.text =node.toXMLString();
]]>
</mx:Script>
<mx:HDividedBox left="10" right="10" top="25"
bottom="10">
<mx:VDividedBox height="100%" width="65%" >
<mx:Panel width="100%" height="450" layout="absolute"
title="Item Generator" >
<mx:Tree id="xmlBound2Tree" dataProvider="{dataX}"
labelField="@label" showRoot="true" editable="{RN.selected}"
top="10" left="10" right="10"
bottom="10" color="#141414"
openEasingFunction="{mx.effects.easing.Bounce.easeInOut}"
openDuration="500" useRollOver="{URO.selected}"
dragEnabled="true" dragMoveEnabled="true"
dropEnabled="true" itemClick="tree_itemClick(event);" />
<mx:CheckBox label="| Use Roll Over" textAlign="left"
color="#848484" id="URO" selected="false" right="15" bottom="10"
labelPlacement="left" themeColor="#7B7B7B"/>
<mx:CheckBox label="Rename" textAlign="left"
color="#848484" id="RN" selected="false" right="128" bottom="10"
labelPlacement="left" themeColor="#7B7B7B"/>
<mx:ControlBar>
<mx:Button label="Remove Selected Item"
click="removeEmployee()" color="#000000" themeColor="#FF0000"/>
<mx:Button label="Generate XML" click="gen_xml()"
color="#000000" themeColor="#80FF4D"/>
</mx:ControlBar>
</mx:Panel>
<mx:Panel title="Passing XML data by reference"
layout="absolute" width="100%" height="62" color="#000000">
<mx:FormItem label="Enter Node Name:" x="10" y="16"
width="484">
<mx:TextInput id="Eparent" text="Node Name"
width="359"/>
</mx:FormItem>
<mx:Button label="ADD AS PARENT"
click="addEmptyBranchDP();" y="48" x="130" width="175"
height="25"/>
<mx:Button label="ADD AS SUB PARENT"
click="addEmptyBranchDD(), showAlert('Red');" themeColor="haloBlue"
y="78" x="130" width="175" height="25"/>
<mx:Button label="ADD AS CHILD" click="addEmptyChild(),
showAlert('Red');" y="48" x="319" color="#000000" width="175"
height="25"/>
<!-- Display the resulting XML -->
</mx:Panel>
</mx:VDividedBox>
<mx:Panel width="35%" height="100%" layout="absolute"
title="XML Code">
<mx:TextArea width="100%" color="#08365D"
fontFamily="Calibri" fontStyle="italic" fontSize="14"
fontWeight="normal" height="100%" text="{dataX.toXMLString()}"
id="textarea"/>
</mx:Panel>
</mx:HDividedBox>
<mx:Label x="10" y="-1" text="MENU GENERATOR"/>
</mx:Application>

Similar Messages

  • How to receive XML from Flex HTTP POST

    Hi,
    We curreontly have a setup where we have a FLEX frontend send an XML through a HTTP POST and awaiting a response also in XML. On the backend this is handled relatively simply by a PHP script that basically does the following:
    read data (in XML)from FlEX HTTP POST into a new temp XML file.
    execute a c++ program with the XML file as one of the parameter.
    return the result to FLEX
    We have decided to move to BlazeDS for various reasons.
    Looking at the examples bundled with BlazeDS they have a jsp example that returns an XML result to FLEX so that part is fine. I am trying to find an example of JSP (or Servlet) that is able to read the XML data from FLEX and write it into a temp XML file. I would then try to use runtime.exec to invoke a local C++ program to process the XML file the result of which will be sent back to FLEX.
    Any help will be very much appreciated!

    <div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>I&#8217;d avoid calling an executable just to process XML &#8211;your<br />application server would provide enough support for reading and writing XML, no?<br />Also, if you&#8217;re only planning on working with XML then even BlazeDS might<br />be overkill because its focus is on sending strongly typed ActionScript data efficiently<br />to and from a client (it&#8217;s true that it does have a proxy service, but<br />that is not involved with processing the actual XML data).<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>How complex is your XML? Do you need to resolve ids and<br />references or can you parse it top down in a single pass? There are several<br />well known libraries in Java for dealing with XML &#8211; the choice depends on<br />how you need to interact with the XML. Most of them take an InputStream as a<br />source for reading XML and you can get the InputStream from the servlet<br />request. Googling should turn up numerous examples.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Pete<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><br /><br /><div><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> khwong<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Sunday, September 28, 2008 12:09 PM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> How to receive XML from Flex HTTP POST<o:p></o:p></span></p><br /><br /></div><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new discussion was started by<br />khwong in <br><br /><br><br /><b>General Discussion</b> --<br><br />  How to receive XML from Flex HTTP POST<br><br /><br><br />Hi, <br><br /><br><br />We curreontly have a setup where we have a FLEX frontend send an XML through a<br />HTTP POST and awaiting a response also in XML. On the backend this is handled<br />relatively simply by a PHP script that basically does the following: <br><br /><br><br />read data (in XML)from FlEX HTTP POST into a new temp XML file. <br><br />execute a c++ program with the XML file as one of the parameter. <br><br />return the result to FLEX <br><br /><br><br />We have decided to move to BlazeDS for various reasons. <br><br /><br><br />Looking at the examples bundled with BlazeDS they have a jsp example that<br />returns an XML result to FLEX so that part is fine. I am trying to find an<br />example of JSP (or Servlet) that is able to read the XML data from FLEX and<br />write it into a temp XML file. I would then try to use runtime.exec to invoke a<br />local C++ program to process the XML file the result of which will be sent back<br />to FLEX. <br><br /><br><br />Any help will be very much appreciated! <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b69b23">How to receive XML from<br />Flex HTTP POST</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b69b23!folder=.3c061a83">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div><br /><br /></div>

  • Generating XML from DOM tree

    Hello,
    I am trying to generate a XML file from a DOM tree. This facility is there in IBM parser.
    But anyone can help me out in generating a XML file or string from a DOM tree using the Crimson parser provided by default in JDK 1.4.0
    Thank you

    The only way I know is to use JDOM (which provides a output package).
    You can build a JDOM tree starting from your DOM tree, and then output this JDOM tree in an XML file.
    Hope it will help.

  • Need Help with send raw xml to PHP from flex

    Hello all,
    I am trying to pass raw XML from flex to php.
    I can pass the data using get but need to use POST.
    When I submit the data via POST
    the data is not available in $HTTP_RAW_POST_DATA.
    Any help is greatly appreciatted

    Hello all,
    I am trying to pass raw XML from flex to php.
    I can pass the data using get but need to use POST.
    When I submit the data via POST
    the data is not available in $HTTP_RAW_POST_DATA.
    Any help is greatly appreciatted

  • Issue with child items of flex tree using QTP

    Hi,
    We are trying to automate Flex web application using QTP10.
    We are facing below issue with Flex tree when we try to automate a scenario of selecting a child item displayed in flex tree.
    Issue:
    On recording the step of selecting an item from Flex tree using QTP, the script displayed is .Select Index1. But when we replay it back no action is being performed.
    Also on object spy we are able to navigate only till flex tree and we are not able to spy child items of flex tree.On the web page the child items are displayed as radio buttons/checkboxes.
    Please provide a solution for me to this problem.
    Thanks

    Hi,
    You could perform a HTTP trace (using HTTP watch) and compare the OCI data in POST method for both users (the correct and incorrect ones).
    Perhaps there is some additional/missing information being passed from catalog to SRM.
    Kind regards,
    Ricardo

  • Passing null/empty values from Flex to a Coldfusion ORM object

    This is the situation.
    If you have an actionscript VO that binds to a Coldfusion ORM object via the RemoteClass metadata and some of the values are not set, null, or empty strings and you pass it from Flex to Coldfusion then the Coldfusion deserialization barfs saying the values are not acceptable date values (for type="date") or valid emails (for validation="email") or other such validations, even if required="false" on the property.
    For instance, if you have the following actionscript VO:
    package vo
        [RemoteClass(alias="com.companyname.Person")]
        [Bindable]
        public class Person
            public var person_id:Number;
            public var last_name:String;
            public var first_name:String;
            public var email:String;
            public var created_date:date;
         public function Person() {}
    And you have the corresponding Coldfusion component:
    <cfcomponent displayname="person" output="false"
        alias="com.companyname.Person"
        schema="dbo" persistent="true"
        table="PERSON">
        <cfproperty name="person_id" type="numeric" fieldtype="id" validate="integer" required="true" column="PERSON_ID"/>
        <cfproperty name="last_name" type="string" column="LAST_NAME" required="true"/>
        <cfproperty name="first_name" type="string" required="true" column="FIRST_NAME"/>
        <cfproperty name="email" type="string" validate="email" required="false" column="EMAIL"/>
        <cfproperty name="date_created" type="date" required="false" column="DATE_CREATED"/>
    </cfcomponent>
    Then if you pass the actionscript VO as is to Coldfusion, the deserialization complains that you do not have a valid email or a valid date for date_created.  This is bad, bad, bad.  Essentially if you have a validation of certain types (email being one) or a date property, or probably some other cases, then you essentially can not make it not required, it automatically makes it required because the Coldfusion serializer considers null/empty values as invalid dates or emails.  But the serializer should not care for values that are not required, there has to be a way to pass null/empty values to these data types, but apparently there's not.  If you pass an empty string ("") you still have the same problem.  I know Coldfusion does not have null values, but there has to be a way to do this, otherwise it defeats the purpose of having required="false" and some kind of validation on the property.
    There seems to be two ways around it.  One is to override the implicit setters for the properties on the Coldfusion side and check for 0 length values yourself, then set the property if it is not, or create your own validation routine.  I ended up creating my own validation function since I didn't want to have to write a setter function for everyone of these cases and I can pass back user friendly validation messages.
    Have other people encountered this problem?  How have you gotten around it?  Thanks.

    Looks like a known workaround to this issue is to wrap the Flex object in an array.
    The ColdFusion CFC will accept that as an array, with the first an only element being a struct, which is the object you built in Flex.

  • How to get Checkbox Value from Flex in PHP.

    Hi,
    I need to know how to get a checkbox value from flex in PHP-POST/GET because I don't know what is the value property of a checkbox in flex.
    Please Help.

    Hi,
    It is very simple. Follow the steps below to achieve the solution,
    1. Write a check-box change event to capture the value of the check box. Store this value in a variable(say bolChkSelected:Boolean).
    2. In step 1 you got the value of the check box. Now your aim is to send the value to php. Declare a httpService in your flex application(i think you are aware of using it).Ok..im writing it
    <mx:HTTPService id="sampleService" resultFormat='e4x' url='http://yourdomain/file.php' result='handleResult()' fault='handleFault()'>
    </mx:HTTPService>
    3. Now the actual solution... u need to send the shcStatus in to php..
    Declare an object to hold the data
    var objparameters:Object={};
    objparameters['CheckBoxdata'] = bolChkSelected;
    --in the above line... 'CheckBoxdata' is used as a parameter to php..you shud have the same variable name while accessing in php file also..
    in php file..
    checkboxstatus = $_POST[''CheckBoxdata''];
    echo checkboxstatus
    thats it..

  • Converting string(which is an xml from the java side) to xml in flex

    Hi,
       I have an xml from the java side which i send as string over amf. I need to convert this to xmllist or xml and bind it to a tree. Could some one help me in doing this. My label field needs to be displayName
    this is my xml that comes as string to the flex side
    <Menu>
      <MenuItem>
        <id>1</id>
        <displayName>Add</displayName>
        <menuList>
          <MenuItem>
            <id>3</id>
            <displayName>Form1</displayName>
            <menuList/>
          </MenuItem>
          <MenuItem>
            <id>4</id>
            <displayName>Form2</displayName>
            <menuList/>
          </MenuItem>
        </menuList>
      </MenuItem>
      <MenuItem>
        <id>2</id>
        <displayName>Delete</displayName>
        <menuList>
          <MenuItem>
            <id>5</id>
            <displayName>Form1</displayName>
            <menuList/>
          </MenuItem>
          <MenuItem>
            <id>6</id>
            <displayName>Form2</displayName>
            <menuList/>
          </MenuItem>
        </menuList>
      </MenuItem>
    </Menu>

    Well, for Binding you will probably need to further convert to XMLListCollection or ArrayCollection.
    Not sure.
    However, that is the way to convert String to XML.

  • Special Character XML Web Service call from Flex

    Hi,
    Let me first give a little background.
    I have to query and return data in XML format. To do so, I have created a custom DSC component. In cases where XML has special characters, LC throws error saying that XML is not properly formed. To over come this issue I used CDATA tag at DSC component. Now LC works as it should and I returns correct result.
    I have a web service call from Flex to get this XML result. Every time i trigger this web service I get an error message saying </document> tag is missing.
    I understand in Flex, web service returned data is wrapped in CDATA tag, thats what i causing all this issue.
    I am not sure, how to handle this situation, I am sure this is a common problem and there should be ways to work around it.
    I would really appreciate if any one could point me in the right direction.
    Thank you ..

    The web service has four operations in it, I need pingQuery operation execution code since it doesnot need any input value.
    I have used code something like this.. Any one please correct me if I am wrong..
    <mx:WebService 
    <mx:WebService> id="webService" wsdl=""https://hydrogen.csd.sc.edu/axis2/services/AcademicHistoryService?wsdl
    >
    <mx:operation name="pingQuery"resultFormat="
    object"result="resultHandler(event);"
    fault="faultHandler(event);"
    >
    <mx:request>
    <PingQuerySpecification>
    <value>
    fsdf
    </value>
    </PingQuerySpecification>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    private function resultHandler(evt:ResultEvent):void {Alert.show(ObjectUtil.toString(evt.result));
    private function faultHandler(evt:FaultEvent):void {Alert.show(evt.message.toString());

  • Processing ArrayCollection or XML in PHP from Flex

    I know this is a Flex forum, but after I use HTTPService with
    POST and an ArrayCollection or XML object as the parameter, anybody
    have the PHP code I would use to grab the parameter on the server
    side?
    Once I have grabbed it and put it in a PHP variable I can
    figure out the rest.
    Thanks!

    One caveat for POST ing XML from AIR is that there is a bug
    and it submits as GET instead. Work-around I had to use was to
    upload XML file instead and then parse it.... otherwise from FLEX
    If you POST the XML as a parameter like so
    var params:Object = new Object()
    params.postText = myXML
    myHTTPService.send(params)
    and your XML is something like.....
    <root>
    <record><data>mydata</data></record>
    </root>
    then the PHP script looks something like.........
    foreach($_POST AS $key => $value) { ${$key} = $value; }
    if(isset($postText)){
    //echo $postText;
    $xml = new SimpleXMLElement($postText, LIBXML_NOCDATA);
    $record = $xml->record;
    // use first record to capture column names into array
    foreach($record[0]->record->children() as $col){
    $colNames[] = $col->getName();
    // then for each column , record get the values
    foreach($record->record as $row){
    foreach($colNames as $column){
    $values[] = $row->$column;
    //do something with the record
    else{
    exit;
    //get record level element name;
    $act = $xml->act;
    $table = $xml->table;
    $record = $xml->records;
    // get column names

  • Flex tree displaying raw XML with tags

    For some reason, after I setup a tree control and set its
    dataprovider to an XML that a coldfusion component is returning,
    the tree will display the raw XML in one node (including tags and
    everything) instead of formatting it into folders and files. At
    first I thought the coldfusion component was formatting the XML
    incorrectly but after I used one of the example XML's in the adobe
    docs, it will still display the RAW xml. This is the code where I
    define the tree control:
    <mx:Tree x="0" y="10" width="266" height="223"
    id="courseTree" dataProvider="{myxml}"/>
    and even using this example XML from the livedocs it still
    doesnt format it and display folders and entries, it will display
    the raw XML with tags:
    <mx:XML id="myxml">
    <Company label="Macromedia">
    <Branch label="Newton">
    <Department label="Flex Doc">
    <Title label="Intern">
    <Name label="Kapil Virdi"></Name>
    </Title>
    </Department>
    </Branch>
    </Company>
    </mx:XML>

    I also tried the following format for the XML as the
    datasource, and it still only displays the raw XML and not format
    it into folders
    <node>
    <node label="Finance" dept="200">
    <node label="John H" />
    <node label="Sam K" />
    </node>
    <node label="Engineering" dept="300">
    <node label="Erin M" />
    <node label="Ann B" />
    </node>
    <node label="Operations" dept="400" isBranch="true" />
    </node>

  • How to send data one row at a time from xml to flex

    I want to setTimerEvent while sending data from xml to flex, one row at a time.
    I have attached the xml.
    Thanks in advance.

    Hi Greg,
    Thanks for the reply. You must have seen the xml which i have attached.Here is the .mxml code which i have written:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="accountData.send()">
    <mx:Script>
    <![CDATA[
    import mx.controls.*;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    private var AccountInformation:ArrayCollection;
    private function AccountHandler(evt:ResultEvent):void
        AccountInformation = evt.result.xml.AccInfo;
    private function faultHandler(evt:FaultEvent):void
        var faultMessage:String = "Could not connect with XML file";
        Alert.show(faultMessage, "Error opening file");
    ]]>
    </mx:Script>
    <mx:HTTPService id="accountData" url="pgm1.xml" result="AccountHandler(event)" fault="faultHandler(event)"  />
    <mx:DataGrid x="20" y="24" width="950" dataProvider="{AccountInformation}" />
    </mx:Application>
    This reads and displays all the rows. But I want to display single row at a time with sometime time gap between the display of two consecutive rows.I am new to flex and this is my first code, so need your help on this.
    I hope i have made myself clear. If there is anything else please let me know.
    Looking forward to some solution.
    Thanks in advance.
    Regards,
    praj58

  • Passing non-key field values to a form from a tree link

    I'd like to be able to link to a record form from a tree, and to pre-populate certain fields in the form from values available in the tree, even if there isn't a record matching the primary key value on the tree.
    I hope that makes sense.
    Let me fill in some more detail. I have dummy nodes in the tree, which don't correspond to data items, but to types of data items ( underneath which I have the real items ). I've made the dummy nodes a link to the form in the same way as the real items, so that when you click on the dummynode, you go to the form ( which is blank) and can create a new record. I'd like to populate the form with as much information as possible when this happens. I've tried adding the fieldname/formvalue to the link string but with no effect.
    Thanks, Mark.
    If the forum allowed screenshots to be posted I could show you what I'm trying to achieve.

    If your form items are of source database column, than it will not work. However, you may create a custom form and have no source for the items. For that, you will need to create a custom procedure to fetch, update and delete the records.
    If I understood your question properly...
    Denes Kubicek

  • Populate Flex Tree from Java Code (Database)

    Hi
    Can someone please help me? I'm very new to using flex. I'm
    basically trying to create a tree that is populated from data in my
    database. I am using hibernate to fetch that data.
    The plan is to basically create the tree in Java code (since
    I don't want any processing done on the client PC) and then pass
    this to the flex tree (or an actionscript data structure that is
    compatible as the tree datasource)
    I am creating the java tree using DocumentImpl. Is this
    correct? What class would work?
    Element e = null;
    Node n = null;
    Document xmldoc= new DocumentImpl();
    Element root = xmldoc.createElement("USERS");

    quote:
    Originally posted by:
    ntsiii
    Stop running and get a map (read the documents)
    This is hardly a useful comment and must discourage new users
    from asking questions. If you think the documentation relating to
    the use of the tree control is straightforward then I beg to
    differ.
    If you are aware of a clear example of how to use the data
    tree with a php backend returning a remote data object please
    enlighten me. Meanwhile I continue my search but not within the
    livedocs.
    One site I have found that may be of use is
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    Not everyone is an expert.

  • How we can show the xml data without any attribute in a flex tree (without having any label field) ?

    how we can show the following data in a flex tree (without having any
    label field) ?
    <?xml version="1.0"?>
    <rootNode>
            <childNode>
            < subchildNode >
                    <valueNode>1000</valueNode >
                    < valueNode >999-888-777</valueNode >
                    < valueNode >STORTZ</valueNode >
                    < valueNode >PAM STORTZ</valueNode >
                    < valueNode >88 ST. MORTON ROAD</valueNode>
            </subchildNode>
            </childNode >
    </rootNode >

    as is - no how
    wrap those xml chunk with a class having clear public properties like:
    public class dataRecord {
         protected var xml:XML;
         function dataRecord(xml:XML) {
              this.xml = xml;
         public function get id ():String {
              return XML(xml.descendants("valueNode")[0]).toString();
         // and so on
    simpliest way is to change xml structure to use attributes than wrapping that thing with AS code, it's time consuming and non efficient.

Maybe you are looking for