Tree control and XML

Hi,
I have an XML file. I want to display the nodes from the XML
using a tree control.
The structure of the XML is
<grandparent>
<parent>
<child1> 1 </child1>
<child2> 2 </child2>
<child3> 3 </child3>
</parent>
<parent>
<child1> 4 </child1>
<child2> 5 </child2>
<child3> 6 </child3>
</parent>
<parent>
<child1> 7 </child1>
<child2> 8 </child2>
<child3> 9 </child3>
</parent>
</grandparent>
Can I display the tree like
grandparent
parent
1
4
7
skipping some children.

Two choices:
1. pre-process the xml into a form the tree can render
directly.
2. Create a custom Tree Data Descriptor
Tracy

Similar Messages

  • Tree control and XML dataprovider

    Hi,
    I am trying to get this xml ( http://mitjafelicijan.net/test.xml ) working with my tree control in my Flex app and cannot figure it out how exactly to do this.
    my Flex code is this
    <mx:Tree left="0" top="0" bottom="0" showRoot="true" id="trvTreeview" right="0"></mx:Tree>
    and my AS code is this
    var tmp:XML = XML(event.target.data);
    trvTreeview.dataProvider = tmp.node;
    I get such output
    http://mitjafelicijan.net/tree.png

    The default data descriptor will see any child node as a child and claim that node is a folder.  If the xml node used attributes like this:
    Then there aren't any child nodes.  However, if you can't change the XML structure you can create a custom TreeDataDescriptor that is smarter about hasChildren()
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Jdeveloper Data Source control and xml file

    Hi
    I was wundering if Jdeveloper can parse a xml file and and show the results in a grid for a xml file just like the webservice control.
    like here
    http://www.oracle.com/technology/obe/obe11jdev/11/wsdc/wsdc.htm
    regards

    If I'm understanding what you are aiming for then the URL Data Control can do this for XML files if you provide the XML Schema for them.
    See this sample:
    http://www.oracle.com/technology/products/jdev/howtos/urldatacontrol/urldatacontrol.html

  • Tree control with xml last node!

    The question is how to view the tree lastleaf as last
    nodename + nodevalue in an xmlobject?
    <node1>
    <node1a>10
    </node1a>
    </node1>
    <node2>
    <node2a>
    <node2b>20
    </node2b>
    </node2a>
    </node2>
    I want the tree structure like:
    Node1 (folder icon)
    Node1a = 10 (doc icon)
    Node2
    Node2a
    Node2b = 20 (doc icon)
    In Flex the tree views:
    Node1 (folder icon)
    Node1a (folder icon)
    10 (doc icon)
    Node2
    Node2a
    Node2b (folder icon)
    20 (doc icon)
    in my app I get a result from a webservice that returns some
    nodes that can have one or more values. Say Node1a can have 10, 34,
    43, so in the tree leaf I it should view Node1a = 10, 34, 43.
    Any suggestions?

    The problem is when the value is between xml tags (
    <node>value</node>) the node name gets folder icon and
    value gets doc. icon.
    With lot of last elements, one has to click every node to see
    the values.
    With labelFunction every leaf gets null value:
    If hasComplex return localname
    Else
    Return localname + children
    When I try to pars xml to new one, hasChildren returns true
    for las element, and if there is no value the node shows null.
    Then walking the xml recursively how do I insert the nodes in
    new xml with the same structure but tags like (<node
    data=”value” />)? (to XMLListCollection)
    Hope it’s clearer

  • List Control and XML data

    I am trying to display XML data from a HTTPReqeust in a list
    control. Here's my mxml:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="aircrafts.send()">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var aircraftDp:XMLList;
    private function aircraftXMLHandler(event:ResultEvent):void
    aircraftDp = event.result.aircraft;
    ]]>
    </mx:Script>
    <mx:HTTPService id="aircrafts"
    url="
    http://localhost:8080/flysafe/aircrafts"
    result="aircraftXMLHandler(event)"
    resultFormat="e4x"/>
    <mx:List x="10" y="53"
    dataProvider="{aircraftDp}"></mx:List>
    </mx:Application>
    The REST service returns the following XML document:
    <aircrafts>
    <aircraft id='0' label='Cessna' href='
    http://localhost:8080/flysafe/aircrafts/0'/>
    <aircraft id='1' label='Piper' href='
    http://localhost:8080/flysafe/aircrafts/1'/>
    </aircrafts>
    The List control is empty. I cannot figure out how to get the
    right connection between the data provider and the xml returned by
    the HTTPRequest.

    I figured it out. The data provider was set up correctly, but
    I wasn't telling the listbox what to use for the label. Adding the
    following attribute to the listbox fixed the problem.
    labelField="@id"

  • Tree control and drop target data

    Hi
    I can't seem to find an answer to my problem anywhere.
    Is it possible to read the data from the node over which an
    item is dragged and accept or reject a drop if for example the node
    data has attribute droppable?
    Attached is the ArrayCollection used to store dummy data.
    I would like to allow dragging elements to Private folder and
    disallow dragging them to Public folder.
    Thanks for any help.

    Yes. Do the logic in the dragOver and dragDrop handlers.
    Tracy

  • Tree Control  and context menu

    Hello,
    I created a tree with a menu. But the menu is not displayed on right click of a node .... Well I can miss something...
    Anybody have an idea for help me ?
    Best regards

    Hi Aurélien,
    This feature is not yet supported. Nonetheless, starting with SP13 you will be able to connect context menus to any ui element in the same way as it is the case in 7.10 with the limitation that context menu inheritance between ui elements along the ui element hierarchy not supported in SP13.
    Best regards,
    Thomas

  • CVI Tree Control and Line Break

    Hi
    Is there a way in  CVI Treecontrol to do a line break if the column is to short ?
    Regards
    juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

    Hi jared,
    If the text is to long there should be a line break
    Regards
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
    Attachments:
    shoot.jpg ‏27 KB

  • How to render image in tree control without embed it

    Hello frndz i am working on tree control and want to show imagein its node through xml list collection.i have searched a lot for this but in every example with tree control images are embeded.i dont want to hardcode the image.Need to make the image comes from database(Xml).so is there any live or demo example for tree control.
    Thanks in Advance
       Vineet osho

    if you decompile the imaging.ear file, there is a web.xml file which you can add the following parameter:
    <context-param>
    <param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
    <param-value>never</param-value>
    </context-param>
    or take a look at      Receiving "Warning: Unable to load content in a frame. Frame content will load at the top level." When Trying to Use the <af:inlineFrame> Component [ID 1266770.1] on Oracle Support.
    Make sure you take a copy of the imaging app before you make changes. You can then upload back through the weblogic console.
    Sudi

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

  • AS 3.0 & WebService & Tree control Bind to hierarchical data?

    What is the trick to get the results of a call to a
    webservice that returns a hierarchical XML SOAP document to map
    directly to a Tree Control's dataProvider property?
    In the debugger, I can see that lastResult is an ObjectProxy
    which has a couple of properties and one of them is an
    ArrayCollection as I expect. However, I can't figure out how to use
    this result with a Tree control and the dataProvider property so
    that I can navigate thru the hierarchy returned.
    TIA
    George

    Yeah this is using the embedded scripting. I need to change this to show the final sql vs. the script that is being used.
    -kris

  • How can I save the all the values of a tree control ?

    I have a problem, in run time, I adds new items on a tree control, but i don´t know how I can save the values of the child text of each item in a file.
    Thanks.

    I'm no expert on the tree control, but I made a small example to save all items to a textfile, including item tag, item string, and indent level. One drawback of this method is that it fully expands the tree regardless how the user left it. To go the other direction, you'd have to write a routine to go through the text file and programmatically build the tree.
    To master the tree control, I think you have to resort to creating a control reference for it and using the Invoke Node to do some operations. For another approach to traversing and operating on a tree, check out the "Traversing Tree Controls and Setting Custom Symbols" (search the NI Developer Zone site).
    Best of luck,
    John
    Attachments:
    Save Tree Structure to Textfile.vi ‏32 KB

  • Please, I need help in this,How to make a tree control appear from right to left ??

    i working on Arabic project in which we use a tree control and i  want it to display its branches from right to left .
    i tried to rotate it but it doesn't work because the disclosure triangle still appear on the left .
    i ask if there is any thing to mirror the tree control ,and ask if this mirroing will work or not?

    You'll need to modify the layout logic of your renderer.
    Here's a simple example that extends the default tree renderer and overrides the updateDisplayList method(). It will probably need more work. Set textAlign="right" on your Tree control when you use this renderer. You'll also need to supply a disclosure icon that points in the opposite direction.
    package
        import mx.controls.treeClasses.TreeItemRenderer;
        import mx.controls.treeClasses.TreeListData;
        public class RightToLeftTreeItemRenderer extends TreeItemRenderer
            override protected function updateDisplayList(unscaledWidth:Number,
                                                      unscaledHeight:Number):void
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                var startx : Number = data ? TreeListData( listData ).indent : 0;
                startx = unscaledWidth - startx;
                if ( disclosureIcon )
                    disclosureIcon.x = startx - disclosureIcon.width;
                    startx = disclosureIcon.x;
                if ( icon )
                    icon.x = startx - icon.width;
                if ( label )
                    label.x = 0;

  • Tree control tip strip for each item

    In tree control is possible set a Tip strip for each item (node) of tree?
    In tree control  tipStrip property seems relative to all tree.
    Thanks all.

    The only thing I can think of is to use an event structure
    use a mouse move event
    Get Cords
    Calculate what item the mouse is over
    Use a Tips property node to write the correct string.
    The hard part will be calculating what item the mouse is over, The Displayed Items property node should help.
    I am actively working on a program that is centered around a tree control and might like to do the same.
    If you need further help reply back 
    Omar

  • TRIAL BALANCE WITH  ALV TREE CONTROL

    Hi Friends,
    My manager wants to see trial balance with cost centers like ALV tree control display.
    Does SAP have any Std trial balance report which can show cost centers also for accounts and activities within those cost centers.
    Please help.
    Thanks

    Nelow message will appear and not possible technically
    Output option ALV Tree Control: Parameter Scaling set to 0/0
    Message no. FR098
    Diagnosis
    You selected output option ALV Tree Control. For technical reasons, only  the value 0/0 is possible for the parameter Scaling.
    System Response
    Parameter Scaling set to the value 0/0.
    Procedure
    If you want to compare the program output for output options ALV Tree Control and Classical list, you have to also set the parameter Scaling  to '0/0' when running the program with output option Classical list.

Maybe you are looking for

  • Problems with authenticated smtp on Mac mail 2

    I do support for a small ISP and we are seeing problems with Mac Mail authenticating to the smtp server. The settings that should work are: outgoing server: asmtp.gorge.net Username: full email address Outgoing server port: 2525 or 587 We typically t

  • Object reading and writing

    i have to read a very large files that consist of header(5000 bytes)main file(10,000 bytes), footer(4000 bytes) this is a binary file.The current code is in c++, the logic implemented is like as:- there are three classes and the data structure define

  • 64-bit acrobat reader plug-in?

    Is there a 64-bit version of the acrobat reader plugin that works with the 64-bit version of IE? I am developing a 64-bit native application and I would love to be able to support PDF documents. My normal process for vieweing PDF documents is to use

  • What is the maximum amount of ram I can upgrade to?

    I've tried looking into this but I guess i'm not very good at finding things sadly. My notebook is a "hp pavilion dv6-6b26sa" I currently have 6gb RAM and Windows 7 OS Thanks, all help appreciated. This question was solved. View Solution.

  • Restauration de données d'un ancien macbook sur un macbook pro

    Bonjour, J'ai acheté aujourd'hui un macbook pro que je viens dont je viens de finir la configuration intégrant la restauration des anciennes données. Lors du démarrage, du macbook pro, je m'attendais à retrouver l'ensemble des données et malheureusem