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>

Similar Messages

  • How to align a raw Xml file tag by tag using java

    Hi All,
    Can any one please help me in writing a java code(jdk1.3) ,which will format a raw xml file and keep the formated data in a string object.

    Ex File:
    <POSBasket><Keyword>1|51|7|4116</Keyword><LastUpdated>2008-03-31T19:01:08+01:00</LastUpdated><MajorVersion>1</MajorVersion><MinorVersion>0</MinorVersion><BasketType>Sale</BasketType><State>Processed</State><Header><DateTimeCreated>2008-03-31T18:41:51+01:00</DateTimeCreated><OriginatedBy><DeviceID>ALL.MAT.51.TILL7</DeviceID><CashierID>051ROD</CashierID><CompanyID>1</CompanyID><StoreID>51</StoreID><BranchID>51</BranchID><TerminalNumber>7</TerminalNumber><TransactionNumber>4116</TransactionNumber></OriginatedBy><TaxMethodID>1</TaxMethodID><CustomerNumber>022578200260577</CustomerNumber><CustomerPan>022578200260577</CustomerPan><LoyaltyAccountNumber>022578200260577</LoyaltyAccountNumber><BasketLanguageID>en</BasketLanguageID><BasketCountryID>GB</BasketCountryID><BasketCurrencyID>GBP</BasketCurrencyID></Header></POSBasket>
    expected format:
    <POSBasket>
    <Keyword>1|51|7|4116</Keyword>
    <LastUpdated>2008-03-31T19:01:08+01:00</LastUpdated>
    <MajorVersion>1</MajorVersion>
    <MinorVersion>0</MinorVersion>
    <BasketType>Sale</BasketType>
    <State>Processed</State>
    <Header>
    <DateTimeCreated>2008-03-31T18:41:51+01:00</DateTimeCreated>
    <OriginatedBy>
    <DeviceID>ALL.MAT.51.TILL7</DeviceID>
    <CashierID>051ROD</CashierID>
    <CompanyID>1</CompanyID>
    <StoreID>51</StoreID>
    <BranchID>51</BranchID>
    <TerminalNumber>7</TerminalNumber>
    <TransactionNumber>4116</TransactionNumber>
    </OriginatedBy>
    <TaxMethodID>1</TaxMethodID>
    <CustomerNumber>022578200260577</CustomerNumber>
    <CustomerPan>022578200260577</CustomerPan>
    <LoyaltyAccountNumber>022578200260577</LoyaltyAccountNumber>
    <BasketLanguageID>en</BasketLanguageID>
    <BasketCountryID>GB</BasketCountryID>
    <BasketCurrencyID>GBP</BasketCurrencyID>
    </Header>
    </POSBasket>
    Can anyone help me on preparing logic using core java ???

  • Generate XML with tag names generated dynamically.

    Hi Mark,
    I want to generate xml in the following way using SQLXoperators.
    But only problem is when i use the operator, the tag name should be supplied before in hand as parameter.
    So it works well when the data for the tags are stored in seperate columns then its pretty simple.
    But lets say the whole hierarchy of the nodes is stored in one table with ID-->PARENTID relationship and the text is stored in a column called description.
    Now using CONNECT BY PRIOR i get the hierarchy and now based on the description value i have to generate the tags and then fill in the other details.
    This is just a summary of what i want. the below sample has much more than that and actual data comes from more than one table.
    But if i get the solution for what i asked before i think i can build the test of the thing.
    <?xml version="1.0" encoding="UTF-8"?>
    <SequenceData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SequenceData.xsd">
         <Header>
              <TemplateName>Template(XML)</TemplateName>
              <TemplateVersion>1.1</TemplateVersion>
              <CreatedUser>rsh2kor</CreatedUser>
              <CreatedDate>17-06-2005 12.12.22</CreatedDate>
         </Header>
         <List>
              <LoadPoints>
                   <LoadPoint description="Loadpoint1_in_list(level one)">
                        <SetPhase>
                             <SetPhaseVariables>
                                  <SetPhaseVariable>
                                       <Name>pRail</Name>
                                       <Unit>bar</Unit>
                                       <Value>100</Value>
                                       <SettlingTime>0.0</SettlingTime>
                                  </SetPhaseVariable>
                             </SetPhaseVariables>
                             <MonitoredVariables>
                                  <MonitoredVariable>
                                       <ID>12344<ID>
                                       <Name>MeasPoint</Name>
                                       <Unit>pascal</Unit>
                                       <Limit>10</Limit>
                                       <Tolerance>0.0</Tolerance>
                                       <Operator>&gt;</Operator>
                                       <AlertType>STOP</AlertType>
                                  </MonitoredVariable>
                             </MonitoredVariables>
                        </SetPhase>
                        <WaitPhase>
                             <WaitingTime>10</WaitingTime>
                             <MonitoredVariables>
                                  <MonitoredVariable>
                                       <Name>MeasPoint</Name>
                                       <Unit>pascal</Unit>
                                       <Limit>10</Limit>
                                       <Tolerance>0.0</Tolerance>
                                       <Operator>&gt;</Operator>
                                       <AlertType>STOP</AlertType>
                                  </MonitoredVariable>
                             </MonitoredVariables>
                        </WaitPhase>
                        <MeasPhase>
                             <MeasPhaseVariables>
                                  <MeasPhaseVariable>
                                       <Name>MeasPoint</Name>
                                       <Unit>pascal</Unit>
                                       <Result>0</Result>
                                  </MeasPhaseVariable>
                             </MeasPhaseVariables>
                        </MeasPhase>
                   </LoadPoint>
              </LoadPoints>
         </List>
         <Loop Iteration="5">
              <LoadPoints>
                   <LoadPoint description="Loadpoint2_in_Loop">
                        <SetPhase>
                             <SetPhaseVariables>
                                  <SetPhaseVariable LoopCount="1">
                                       <Name>pRail</Name>
                                       <Unit>bar</Unit>
                                       <Value>10</Value>
                                       <SettlingTime>0.0</SettlingTime>
                                  </SetPhaseVariable>
                                  <SetPhaseVariable LoopCount="2">
                                       <Name>pRail</Name>
                                       <Unit>bar</Unit>
                                       <Value>20</Value>
                                       <SettlingTime>0.0</SettlingTime>
                                  </SetPhaseVariable>
                                  <SetPhaseVariable LoopCount="3">
                                       <Name>pRail</Name>
                                       <Unit>bar</Unit>
                                       <Value>30</Value>
                                       <SettlingTime>0.0</SettlingTime>
                                  </SetPhaseVariable>
                                  <SetPhaseVariable LoopCount="4">
                                       <Name>pRail</Name>
                                       <Unit>bar</Unit>
                                       <Value>40</Value>
                                       <SettlingTime>0.0</SettlingTime>
                                  </SetPhaseVariable>
                                  <SetPhaseVariable LoopCount="5">
                                       <Name>pRail</Name>
                                       <Unit>bar</Unit>
                                       <Value>50</Value>
                                       <SettlingTime>0.0</SettlingTime>
                                  </SetPhaseVariable>
                             </SetPhaseVariables>
                             <MonitoredVariables>
                                  <MonitoredVariable>
                                       <Name>MeasPoint</Name>
                                       <Unit>pascal</Unit>
                                       <Limit>10</Limit>
                                       <Tolerance>0.0</Tolerance>
                                       <Operator>&gt;</Operator>
                                       <AlertType>STOP</AlertType>
                                  </MonitoredVariable>
                             </MonitoredVariables>
                        </SetPhase>
                        <WaitPhase>
                             <WaitingTime>10</WaitingTime>
                             <MonitoredVariables>
                                  <MonitoredVariable>
                                       <Name>MeasPoint</Name>
                                       <Unit>pascal</Unit>
                                       <Limit>10</Limit>
                                       <Tolerance>0.0</Tolerance>
                                       <Operator>&gt;</Operator>
                                       <AlertType>STOP</AlertType>
                                  </MonitoredVariable>
                             </MonitoredVariables>
                        </WaitPhase>
                        <MeasPhase>
                             <MeasPhaseVariables>
                                  <MeasPhaseVariable>
                                       <Name>MeasPoint</Name>
                                       <Unit>pascal</Unit>
                                       <Result>0</Result>
                                  </MeasPhaseVariable>
                             </MeasPhaseVariables>
                        </MeasPhase>
                   </LoadPoint>
              </LoadPoints>
              <List>
                   <LoadPoints>
                        <LoadPoint description="Loadpoint3_in_list(level two)">
                             <MonitoredVariables/>
                             <SetPhase>
                                  <SetPhaseVariables>
                                       <SetPhaseVariable>
                                            <Name>pRail</Name>
                                            <Unit>bar</Unit>
                                            <Value>100</Value>
                                            <SettlingTime>0.0</SettlingTime>
                                       </SetPhaseVariable>
                                  </SetPhaseVariables>
                                  <MonitoredVariables>
                                       <MonitoredVariable>
                                            <Name>MeasPoint</Name>
                                            <Unit>pascal</Unit>
                                            <Limit>10</Limit>
                                            <Tolerance>0.0</Tolerance>
                                            <Operator>&gt;</Operator>
                                            <AlertType>STOP</AlertType>
                                       </MonitoredVariable>
                                  </MonitoredVariables>
                             </SetPhase>
                             <WaitPhase>
                                  <WaitingTime>10</WaitingTime>
                                  <MonitoredVariables>
                                       <MonitoredVariable>
                                            <Name>MeasPoint</Name>
                                            <Unit>pascal</Unit>
                                            <Limit>10</Limit>
                                            <Tolerance>0.0</Tolerance>
                                            <Operator>&gt;</Operator>
                                            <AlertType>STOP</AlertType>
                                       </MonitoredVariable>
                                  </MonitoredVariables>
                             </WaitPhase>
                             <MeasPhase>
                                  <MeasPhaseVariables>
                                       <MeasPhaseVariable>
                                            <Name>MeasPoint</Name>
                                            <Unit>pascal</Unit>
                                            <Result>0</Result>
                                       </MeasPhaseVariable>
                                  </MeasPhaseVariables>
                             </MeasPhase>
                        </LoadPoint>
                   </LoadPoints>
              </List>
         </Loop>
    </SequenceData>
    Pls help as soon as possible.
    Thanks.

    I'm not Mark, but check out this article it may be helpful.
    http://www.oracle.com/technology/oramag/oracle/05-may/o35asktom.html
    In 10g there are other SQL statements besides connect by prior for parent child relationships.
    such as:
    CONNECT_BY_ROOT—returns the root of the hierarchy for the current row; this greatly simplifies our query. (See below for an example).
    CONNECT_BY_ISLEAF—is a flag to tell you if the current row has child rows.
    CONNECT_BY_ISCYCLE—is a flag to tell you if the current row is the beginning of an infinite loop in your hierarchy. For example, if A is the parent of B, B is the parent of C, and C is the parent of A, you would have an infinite loop. You can use this flag to see which row or rows are the beginning of an infinite loop in your data.
    NOCYCLE—lets the CONNECT BY query recognize that an infinite loop is occurring and stop without error (instead of returning a CONNECT BY loop error).

  • 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

  • TAGS WHICH CANNOT BE DISPLAYED IN XML ARE TO BE INCLUDED IN TEMPLATE

    Hi,
    Can I have some inputs to solve an issue that is haunting me ?
    I need to generate an XML with predefined tags and cant add any extra tags.
    Apart from that I also need to generate a pdf file using a rtf template. The issue I am facing is , there are various fields in the rtf template which are not there in XML.
    How do I display fields in the template where as I cant display or rather include them in the XML ?
    Or can we generate two XMLs and pass one of them for the generation of the pdf and the other be kept as it is ?
    Thanks
    Rajiv Sengupta

    Thank you very much for the suggestions.
    But the issue I am facing is, there are 140 Codes and Descriptions that can be picked up dynamically and display in a Field. Also the field should be able to display more than one codes and the Description of those Codes(if selected) I cannot hard code 140 Codes and their description in a field in rtf. That will take too much time in the generation of pdf from rtf . Also it will be difficult to clear the GSCC Errors when the same rtf will be used for the R12. So hardcoding the 140 Codes is doesnt seem to be a great option.
    The Code can be picked from the XML , which is in legislative format. But the XML will not contain the descriptions of the Code. I am archiving the Description of the Code, but cannot include it in XML.
    But I need to display the description of the particular code in the PDF. Please suggest.
    Thanks
    Rajiv Sengupta
    Message was edited by: Rajiv Sengupta
    user633142

  • 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.

  • 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

  • Help using dynamic XML with Tree Menu

    Can some one please help me? I don't know what I'm doing
    wrong. I'd simply like to be able to load an XML file of data and
    use this data to populate a Flex tree component.
    The XML file needs to reside on the server and will change
    from time to time, so I am loading it via an HTTPService call. The
    part that I can't get to work is the way the
    XML is displayed in the Tree component. It ends up blank or
    sometimes I just get the result of "[object Object]". I know my
    syntax must be screwed up somewhere, but because
    AS3 and Flex are new territory for me, I can't get it to
    work. I am feeling my IQ drop on a minute to minute basis. Please
    help me if you can! Thanks!
    In this example, I am expecting a list of the different
    groceries/categories to show up in the tree menu. Instead, I get
    nothing.
    HERE IS THE XML FILE, CALLED "groceries.xml":
    <catalog>
    <category name="Meat">
    <product name="Buffalo" cost="4" isOrganic="No"
    isLowFat="Yes"/>
    <product name="T Bone Steak" cost="6" isOrganic="No"
    isLowFat="No"/>
    <product name="Whole Chicken" cost="1.5" isOrganic="Yes"
    isLowFat="No"/>
    </category>
    <category name="Vegetables">
    <product name="Broccoli" cost="2.16" isOrganic="Yes"
    isLowFat="Yes"/>
    <product name="Vine Ripened Tomatoes" cost="1.69"
    isOrganic="No" isLowFat="Yes"/>
    <product name="Yellow Peppers" cost="1.25"
    isOrganic="Yes" isLowFat="Yes"/>
    </category>
    <category name="Fruit">
    <product name="Bananas" cost="0.95" isOrganic="Yes"
    isLowFat="Yes"/>
    <product name="Grapes" cost="1.34" isOrganic="No"
    isLowFat="Yes" />
    <product name="Strawberries" cost="2.5" isOrganic="Yes"
    isLowFat="Yes"/>
    </category>
    </catalog>
    HERE IS THE MXML FLEX FILE THAT ISN'T WORKING AS I'D LIKE IT
    TO:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" initialize="initializeHandler(event)" width="240"
    height="340">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection;
    import mx.collections.ICollectionView;
    import mx.controls.List;
    private function initializeHandler(event:Event):void {
    textService.send();
    private function resultHandler(event:Event):void {
    myTree.dataProvider = textService.lastResult.catalog;
    ]]>
    </mx:Script>
    <mx:HTTPService id="textService" url="groceries.xml"
    result="resultHandler(event)" />
    <mx:Tree id="myTree" labelField="@name" showRoot="false"
    x="20" y="20" width="200" height="300" />
    </mx:Application>
    Any help is deeply appreciated.

    You must specify a resultformat of e4x. The default
    resultFormat is object. Object only works when you have a very
    simple xml structure that can be consistently represented as a set
    of objects.

  • Can't get out.print to work with XML jsp tags

    <jsp:scriptlet>
    if(ErrorTrap == true) {
         out.println("<tr><td colspan=\"center\" align=\"center\">There was" an error while processing the form</td></tr>");
         ErrorTrap = false;
    </jsp:scriptlet>
    I can't get this script to work with the XML stype jsp tags. It keeps telling me the <jsp> tags are untermintaed. Is there a special trick to fix this or do I have to use the non-XML type tags?

    Sorry, I didn't mean to put the extra " in the out.println text string. :-/

  • XML Parsing with Tags increasing in no's

    I have an XML that I am recieving it from other system like below :
    <ResultSet>
      <ERROR_CODE_ID>0</ERROR_CODE_ID>
      <ERROR_DESCRIPTION>Success</ERROR_DESCRIPTION>
    <Rows>
    <Row1>
      <RATE_EFFECTIVE_DT>2013-08-24
    00:00:00.0</RATE_EFFECTIVE_DT>
    <INDEX_NAME>LN-EBOR-7D-AED              
    </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>7D</TERM>
      <TERM_NO>7</TERM_NO>
      <TERM_PERIOD>D</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.15430000</RATE>
    </Row1>
    <Row2>
      <RATE_EFFECTIVE_DT>2013-08-26
    00:00:00.0</RATE_EFFECTIVE_DT>
      <INDEX_NAME>LN-EBOR- 1M-AED  
               </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>1M</TERM>
      <TERM_NO>1</TERM_NO>
      <TERM_PERIOD>M</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.52430000</RATE>
    </Row2>
    <Row3>
      <RATE_EFFECTIVE_DT>2013-08-25
    00:00:00.0</RATE_EFFECTIVE_DT>
    <INDEX_NAME>LN-EBOR-2M-AED              
    </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>2M</TERM>
      <TERM_NO>2</TERM_NO>
      <TERM_PERIOD>M</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.66710000</RATE>
    </Row3>
    <Row4>
      <RATE_EFFECTIVE_DT>2013-08-24
    00:00:00.0</RATE_EFFECTIVE_DT>
      <INDEX_NAME>LN-EBOR-
    3M-AED             
    </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>3M</TERM>
      <TERM_NO>3</TERM_NO>
      <TERM_PERIOD>M</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.86140000</RATE>
    </Row4>
    <Row5>
      <RATE_EFFECTIVE_DT>2011-05-23
    00:00:00.0</RATE_EFFECTIVE_DT>
      <INDEX_NAME>LN-EBOR-
    4M-AED             
    </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>4M</TERM>
      <TERM_NO>4</TERM_NO>
      <TERM_PERIOD>M</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.0</RATE>
    </Row5>
    </Rows>
    </ResultSet>
    The data is comming in multiple row tag with Row1,Row2,Row3...so on.
    I am not able to parse the XML with Row1,Row2..etc. I need some help.

    Do you want to do this using Oracle database (which version?), or some other tools ?

  • How to combine a raw xml file stored in a table field withe other sql query in . xsq

    I created .xsql file like this:
    <xsql:query>
    select xml_file from my_table
    </xsql:query>
    xml_file is field in my_table,it stores raw xml files.
    the xml file in the result is in text format, not in xml format,how to convert the file into xml format in the result

    See the "document" demo that ships with the XSQL servlet for an example of how to do this.
    It lives in the ./demo/document subdirectory.

  • Unmarshal SOAP response, as raw XML String with JAXB

    Hi,
    I have a soap response, as raw xml (a java.lang.String), and I want to unmarshal it's content into the classes generated by wsimport.
    This must be a simple task but I couldn't find a way to do it.
    Can someone tell me how I can achieve this ?
    Edited by: Raphael_Lemaire on May 25, 2010 8:30 AM

    Raphael_Lemaire wrote:
    Yes it works this way.
    I kind of hoped that i could use a jax-ws api to shorten the code.well, how exactly do you get that string full of xml? (as a side note, you need to be careful turning xml into strings, the data can easily broken if you don't translate the bytes into characters correctly). if you use the jaxws api to make soap calls, then you don't really need to deal with the xml at all.
    Edited by: jtahlborn on May 26, 2010 7:38 AM

  • 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>

  • Filter Tree-view display source xml

    I have a treeview that displays an xml structure.
    I converted the xml to an XMLListCollection, and ran a filter
    but this only filters the parent node, I need to filter children
    from the treeview display.
    I can make a new xml from the original only containing the
    data I need, however I need the xml data information for another
    display window when selected. I just don't want it as a tree node.
    any ideas
    Thanks

    "flashharry!" <[email protected]> wrote in
    message
    news:gbrt5l$rf$[email protected]..
    > Thinks for the input, I understand to make a copy of the
    xml, the filter
    > function does not work as it only looks at the parents
    of the xml and not
    > the
    > children.
    >
    > Here's my issue, I want display in my treeview, 3 levels
    parent-children
    > of
    > xml. There are 4th and 5th levels of the xml. I don't
    want them to appear
    > in
    > the treeview, however when a user selects one of the
    parent nodes in the
    > tree,
    > I need to get the details from the 4th and 5th level.
    >
    > If I make copy of the xml, that grabs everything except
    the 4th and 5th
    > level
    > of the xml, when a user select one of the nodes, how do
    I get the data
    > that was
    > in level 4 and 5.
    >
    > I hope that makes sense.
    I think you can create your own data definition for a tree

  • Connect xml with flex

    Dear Friends,
    iam doing my first project in flex. trying to connect a xml
    generated by php connected to mysql. i took an example from the
    following link:
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showDetails&postId=5561&produ ctId=2&loc=en_US
    my xml is generated. working fine. when i run my Flex, it is
    not working. it is giving the following error
    Process terminated without establishing connection to
    debugger.
    Command:
    "C:\Program Files\Adobe\Flex Builder
    3\sdks\3.2.0\bin\adl.exe"
    C:\Rahim\TestApplications\Flexapplication\xmltest\bin-debug\xmltest-app.xml
    C:\Rahim\TestApplications\Flexapplication\xmltest\bin-debug
    Output from command:
    invocation forwarded to primary instance
    my flex file is :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    initialize="doSend()"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var datalist:ArrayCollection;
    private function resultHandler(event:ResultEvent):void{
    datalist = event.result.data.row;
    public function doSend():void {
    xmlFromDatabase.url = "
    http://localhost/flex/flexdb.php";
    xmlFromDatabase.send();
    ]]>
    </mx:Script>
    <mx:HTTPService url="
    http://localhost/flex/flexdb.php"
    id="xmlFromDatabase"
    showBusyCursor="true"
    result="resultHandler(event)"
    method="GET" />
    <mx:DataGrid x="10" y="10" dataProvider="{datalist}"
    id="dg">
    <mx:columns>
    <mx:DataGridColumn headerText="Col1" dataField="id"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>
    Thanks and Regards,
    Syed Abdul Rahim

    hi _funkyboy ,
    thks for ur msg. i tried using run also.. still not
    running... can u pls advice me wt to do. i got struct up.. i have
    to do this.
    tell me how to connect xml which was generated by php and
    fetch the data and display in Flex.
    thanks and regards,
    Syed Abdul Rahim

Maybe you are looking for

  • How to get all photos from iCloud to iphone6?

    I just got the iPhone 6 and not all of my photos transferred from the cloud?  Is here something I need to do or does it take time?

  • IMac won't go into sleep mode when Kensington Dome Hub

    Has anyone had problems with their computer sleeping when the Kensington USB Dome Hub is connected. This just started happening a few days ago. I isolated the problem and it is definitely the Kensington HUB -- there is nothing connected to the hub th

  • Rename Photo - Bug in sequence numbers

    I am trying to do a rename of several files at once, but I would like it to use a Custom Name WITHOUT a sequence on the first file.  I should be able to select several files and the first file will get the custom name, the second file will get -2, th

  • How do I change colour scheme on iphone S4?

    I just ran the update on my phone. The green colour scheme for icons etc is vile, just looking at it makes me queasy, the keypad impossible to see in bright light - a catastrophe! How do I change it back to what it was or at least to something that i

  • HT3275 iMac.sparsebundle" is already in use.

    I continue to have this message pop up, even after I reboot the time machine. I can usually back up at least once until it happens again. I just cant seem to find what other computer seems to have its attantion. any Ideas as to h ow to find what is t