Assigning Complext XML as DataProvider to Flex Tree

I have complex XML structure to fed as dataprovider for FlexTree. Wanted to know how can i specify the grouping.My sample XML structure looks like this ->
<root>
     <Group>
          <name>
          <size>
          <location>
          <children>
              <Group>
                    <name>
                    <size>
                    <location>
               </Group>
          </children>
     </Group>
     <Group>    
          <name>
          <size>
          <location>
          <children>
               <Group>
                    <name>
                    <size>
                    <location>
          </children>
     </Group>
</root>
I could actually say element "Group" can have Group within itself as child.I want to display them in Tree.How can i accomplish this.I searched so many examples no one have solution for this.Help greatly appreaciated.Thanks a ton.
Thanks,
Manohar.

I think you need a custom ITreeDataDescriptor.

Similar Messages

  • Dataprovider for Flex Tree

    how do you dynamically populate nodes in the Flex tree with data from a database?
    For example... if I have a node for Groups and a database for names of groups... how would I populate the child nodes of the Groups folder with the names of the groups in the database?

    alright i'll experiment. you may be able to help me understand why this isn't working though... this is the route i was going down:
    i wanted to convert this mxml to actionscript and bind it to the tree (so i can add results from my dataprovider):
        <mx:XMLListCollection id="treeData">
            <mx:source>
          <mx:XMLList>
                  <node label="Items">
                      <node label="Open"/>
                      <node label="In Progress"/>
                  </node>
          </mx:XMLList>
            </mx:source>
        </mx:XMLListCollection>
    and i was trying this code to make it bindable:
    var stringData:String = '<node label="Items">' + '<node label="Open"/>' + '<node label="In Progress"/>'
    + '</node>';
    var treeData= new XMLList(stringData);
    but when i use actionscript to create the treeData variable... and use {treeData} as the binding data... nothing shows in my tree.

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

  • Change the root of Flex Tree dynamically

    I have a Flex Tree constructed dynamically. The dataprovider is xmllistcollection.The user clciks on a button to add an item(node) to the tree.
    when user tries to add 2nd item to the tree I want to create root(with a button) at the top automatically.
    So  a Root need to be created dynamically after 2nd item is added.
    Can someone please help me in getting this.
    I am using MXTreeItemrender  as Itemrender and was able to add nodes. But I could not get the third item(I am taking this xml node as Branch and adding) added to the top of the tree.
    Any help is very much appreciated

    Or in APEX 4.0 this can be done using a Dynamic Action that executes JavaScript code to change the region title.
    Give the region a static region ID for use in a jQuery selector.
    As solutions may be dependent on APEX version&mdash;among other factors&mdash;always specify the following information in your initial post:
    <li>APEX version
    <li>DB version and edition
    <li>Web server architecture (EPG, OHS or APEX listener)
    <li>Browser(s) used
    <li>Theme
    <li>Templates
    <li>Region type

  • XML Parsing error in Flex

    Hello Experts,
    I am passing a XML document form the Java to Flex using Remote Object.  My XML is as follows
    <root>
    <dept ID="1" Name="RND"
        <Emp ID="1" Name="Aj"/>
    </dept>
    <dept ID="2" Name="ENG">
    <Emp ID="1" Name="Aj"/>
    </dept>
    <dept ID="3" Name="MECH">
        <Emp ID="1" Name="Aj"/>
    </dept>
    </root>
    In Flex i am trying to access using below code
         treeData = event.result as XML;
         deptTree.dataProvider = treeData;
    I am getting the below exception and
    [RPC Fault faultString="org.w3c.dom.DOMException : INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. " faultCode="Server.Processing" faultDetail="null"]
        at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
        at mx.rpc::Responder/fault()
        at mx.rpc::AsyncRequest/fault()
        at NetConnectionMessageResponder/statusHandler()
        at mx.messaging::MessageResponder/status()
    When i tried creating this XML locally and tried to access then i didn't faced any issue.
    Please help me to resolve this issue.
    Thanks in advance.
    Aj

    Hi
              I think this will help u
    DOMException.INVALID_CHARACTER_ERR (Error Code  5)
    W3C DOM Level 1
    A DOMException.INVALID_CHARACTER_ERR is thrown  whenever an                         invalid or illegal character is specified, such  as in a name.
    NOTE: Names in XML  can contain                         English letters (of any case), numbers (0-9),  underscores (_), periods(.)                         and hyphens (-). Names cannot begin with a  number, period or hyphen.                         Names can also contain a colon, but the use of  colons outside of namespaces                         should be avoided.
    XML for <SCRIPT> uses the following  regular expression to determin                         if a name is valid:
    /^[a-zA-Z_:][a-zA-Z0-9\.\-_:]*$/
    Example:
    function xmljsDOMExample() {
    var xml;
    xml = ""
    + "<?xml version=\"1.0\"?>"
    + "<ROOT>"
    + "<TAG1>"
    + "Hello"
    + "</TAG1>"
    + "</ROOT>";
    //instantiate the W3C DOM Parser
    var parser = new DOMImplementation();
    //load the XML into the parser and get the  DOMDocument
    var domDoc = parser.loadXML(xml);
    //get the root node
    var docRoot = domDoc.getDocumentElement();
    //The following should raise a  DOMException.INVALID_CHARACTER_ERR
    //because element names cannot contain the  "*" character
    try {
    domDoc.createElement("***");}
    catch (e) {
    if (e.code ==  DOMException.INVALID_CHARACTER_ERR) {
    //display the error message
    alert(parser.translateErrCode(e.code));
    else {
    alert("unexpected exception");
    alert(e.code);
    }// end function xmljsDOMExample

  • How to Flex tree control using folder click event  to pass coldfusion to get data from dynamiclly ?

    Hi friends.........
                Iam using flex tree control data coming from coldfusion file to display grid. As i click the tree folder to change the data from dynamic from grid.
    How to pass the folder id from coldfusion file.. Is it possible ?.. Means give any example please....
    Any One Help Me......
    With Regards.,
    Lingu.......

    When you set the dataProvider for your tree control, you actually pass an array or arraycollection or whatever to that property. The array contains objects coming from your server, right? Each object should contain a property with the folder id, something like:
    var arr:Array = [{id: 1, folderID: 34, name: "..."}, {id: 2, folderID: 4, name: "..."}, ...];
    Now, when you click an item in your tree or your dataGrid, you can access the folder id by:
    myTree.selectedItem.folderID
    Hope this helps
    Dany

  • How to Edit the xml node value using flex from the front end UI

    Hi All,
    I am having a use case with flex 4.6
    1> To read the external xml file
    2> Display the tree structure in the front end UI
    3> Edit the node values of the xml file from the front end UI and save it back
    How to go about the above use case, any blogs or links on the above case will be help
    Thanks,
    Alok

    Check this is example:
    http://blog.flexexamples.com/2009/07/23/deleting-nodes-from-an-xml-object-in-flex/

  • Flex tree

    Hi. I have some problem with Flex tree component.
    When I have XML (1), then I have correct tree output
    folder
    -item
    -item
    But when I create something like(2) , then I will have folder
    XXX like item.
    How can I solve it ?

    hi theosa
    try these
    <folder label="XXX" isBranch="true"/>

  • Its illegal to assign a XML value directly to the messageType variable

    I was recently working in JDeveloper 11g (11.1.1.7.0)  on an internal SOA project making some changes in the BPEL and noticed this message: Error(172): its illegal to assign a XML value directly to the messageType variable "InvokeFetchUpdatedUserId_FetchUpdatedUserID_InputVariable" I searched for this error message and didn't find anything.  The message is somewhat explanatory but I thought I would post the fix here just in case.  I modified my assign from the following:                                                                                                                           To this making sure to assign it to the underlying entity.                                                                                                                           Then it compiled just fine. Thanks, Tom

    In case if you are returning multiple value or with multiple columns then you have to use record or cursor to do that operation.
    satyaki>
    satyaki>ed
    Wrote file afiedt.buf
      1  declare
      2       cursor c1
      3       is
      4         select *
      5         from emp;
      6       r1 c1%rowtype;
      7     begin
      8       for r1 in c1
      9       loop
    10         dbms_output.put_line(r1.empno||' - '||r1.ename);
    11       end loop;
    12*   end;
    13  /
    7521 - WARD
    7654 - MARTIN
    7788 - SCOTT
    7839 - KING
    7844 - TURNER
    7876 - ADAMS
    7900 - JAMES
    7902 - FORD
    7934 - MILLER
    7566 - Smith
    7698 - Glen
    1 - boock
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    satyaki>
    satyaki>
    satyaki>Regards.
    Satyaki De.

  • Generate an XML file from a DOM tree

    Hi,
    I'm trying to generate an XML file from a DOM tree that I obtained from another XML file with the Xerces library. I used the following operation :
    public static void writeXmlFile(Document doc, String filename) {
    try {
    Source source = new DOMSource(doc);
    File file = new File(filename);
    Result result = new StreamResult(file);
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.transform(source, result);
    } catch (TransformerConfigurationException e) {
    System.err.println(e);
    System.exit(1);
    } catch (TransformerException e) {
    System.err.println(e);
    System.exit(1);
    But I have this Windows/Linux problem. When I execute this on Windows, everything is correct. But if I try on Linux (every distribution does the same thing), I obtain an XML file where everything is written on just ONE LINE : there is neither identation nor carriage return at the end of a line ... And that is pretty annoying 'cause I need to SEE what I generate ...
    Thanks for your answer,
    Blueberryfin.

    Actually I would think that no indents and no new-lines would be more correct, but maybe it's an option for parsers to do it either way if you don't specify it. If you want to specify it, look at this post from last month:
    http://forum.java.sun.com/thread.jsp?forum=34&thread=383400

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

  • Flex Tree Vertical Scroll Bar Issue

    When i click on the + image of flex tree than first time the vertical scroll bar is not coming but when when i minimize it and again click on + than it appears can any one tell me what is the issue??

    Hi Rob,
    I have tried changing styles of those div's in  which I have my dropdown's are there but it didnt work.
    Below is the code for reference:
    <div class="k-animation-container km-popup" style="width: 250px; height: 206px; margin- padding- padding-right: 10px; padding-bottom: 15px; display: none; "><div class="k-list-container k-popup k-group
    k-reset" id="MaintenanceType-list" data-role="popup" style="height: 200px; display: none; font-family: 'Segoe UI', Verdana, Tahoma, Arial; font-size: 11px; font-style: normal; font-weight: normal; line-height: normal; width: 244px; -webkit-transform: translateY(-206px);"><ul
    unselectable="on" class="k-list k-reset" tabindex="-1" role="listbox" aria-hidden="true" id="MaintenanceType_listbox" aria-live="off" style=""><li tabindex="-1" role="option" unselectable="on" class="k-item"></li><li tabindex="-1" role="option"
    unselectable="on" class="k-item">AUX - Accessories belonging to EA group</li><li tabindex="-1" role="option" unselectable="on" class="k-item">ARL - Artificial Lift</li>
    Regards,
    Jyothi

  • Edit node name in flex tree

    I want to edit a node in flex tree. Editable property of the
    tree makes all nodes editable based on "SELECT" action . But now
    based on my custom selection I want to edit a particular node. I
    thought of custom item renderer and item editor but that applies to
    all the nodes on "SELECT" action. Please let me know how to edit
    particular nodes based on particular action.
    Ex: On click of a button i want to edit the name of node
    (Node is just text with folder icon).
    Tx..
    Flextron

    Flextron,
    I was trying to find an answer to the same issue. After
    walking through the Tree and List class a bit I came up with this.
    Here is an example where the Tree is not editable and double
    clicking a node will allow you to rename it.
    tree.addEventListener( ListEvent.ITEM_DOUBLE_CLICK,
    itemDoubleClick );
    tree.addEventListener( ListEvent.ITEM_EDIT_END, itemEditEnd
    private function itemDoubleClick( event:ListEvent=null
    ):void
    tree.editable = true;
    tree.editedItemPosition = {rowIndex:tree.selectedIndex};
    private function itemEditEnd( event:ListEvent=null ):void
    tree.editable = false;
    - Jank

  • 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

  • XML as dataProvider for Charts

         I want to display XML exported from Oracle Database as a chart......
    The xml has the following structure :
    <ROWSET>
          <ROW>
                <ORDER_ITEMS_ID>1</ORDER_ITEMS_ID>
                <ORDER_ID>1</ORDER_ID>
                <PRODUCT_ID>1</PRODUCT_ID>
                <UNIT_PRICE>1200</UNIT_PRICE>
                <QUANTITY>1</QUANTITY>
          </ROW>
          <ROW>
                <ORDER_ITEMS_ID>2</ORDER_ITEMS_ID>
                <ORDER_ID>7</ORDER_ID>
                <PRODUCT_ID>1</PRODUCT_ID>
                <UNIT_PRICE>1100</UNIT_PRICE>
                <QUANTITY>3</QUANTITY>
          </ROW>
    </ROWSET>
    I've seen many chart examples using ArrayCollection as DataProvider . using the same way , i tried to set xml . But no results.
    Can you please suggest me how to set an XML as dataprovider ? ( or XMLList or XMLlistcollection )
    ( i'm developing a small app in AIR )

    Sample app from Adobe's livedocs:
    XML:
    <data>
        <result month="Jan-04">
            <apple>81768</apple>
            <orange>60310</orange>
            <banana>43357</banana>
        </result>
        <result month="Feb-04">
            <apple>81156</apple>
            <orange>58883</orange>
            <banana>49280</banana>
        </result>
    </data>
    Application:
    <?xml version="1.0"?>
    <!-- charts/XMLFileDataProvider.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Model id="results" source="../assets/data.xml"/>
      <mx:Panel title="Line Chart">
         <mx:LineChart id="myChart" dataProvider="{results.result}" showDataTips="true">
            <mx:horizontalAxis>
               <mx:CategoryAxis categoryField="month"/>
            </mx:horizontalAxis>
            <mx:series>
               <mx:LineSeries yField="banana" displayName="Banana"/>
               <mx:LineSeries yField="apple" displayName="Apple"/>
               <mx:LineSeries yField="orange" displayName="Orange"/>
            </mx:series>
         </mx:LineChart>
         <mx:Legend dataProvider="{myChart}"/>    
      </mx:Panel>
    </mx:Application>
    Tanu

Maybe you are looking for

  • Easy read-only access for noobs

    Lightroom is a great product for the photographer, but for his spouse it's not so easy.  I'd like an easy way to copy an image to the clipboard or export it to iPhoto to be used in other apps like iWeb. My photos are stored on a server.  It should be

  • Extended Classic vs Standalone

    Hi, 1. Can i choose between Extended Classic vs Standalone, I might sound stupid, still i want to hear from this forum. 2. Per my understanding, i can choose to be fully classic by activating Activate Extended Classic Scenario or Partly Classic and E

  • SharePoint site suddenly Read Only even for Administrators!

    So at some point in time something had happened to our SharePoint 2010 server to cause what appeared to be a total lock down on the SharePoint sites.

  • XSS/ESS Web Dynpro Design Principles

    Dear NetWeaver Web Dynproers Kind of wondering if any of you have any high level/detailed documentation on Web Dynpro Design principles used by SAP while building XSS business package? Looking at the Web Dynpro XSS Code there seems to use a consisten

  • Hi one qury

    1. can we do back ground scheduling for gui_upoad before creating the session. i  mean can we upload the data from flat file to internal table in back groud process? is there any possible situation for tis?