JDev10g: Using a Tree component based on different queries.

Hello,
I've been doing some research on how to implement a tree component in ADF which I got working. However I need to implement a tree component that uses several different queries.
The parent node would be one query, the child/leaf nodes would be based on another query but still related to the parent.
For Example: 'select parent_nodes from mydatabase' then 'select child_nodes from mydatabase where child_nodesID = parent_nodesID'
This will ultimately have to branch down more levels but I'm not sure exactly how to achieve this. I'm thinking I have to create new View Objects but I'm not sure exactly how to do that either.
Thank you in advance.

For an SQL query on a database use a View Object. First, you will need to create a new Entity object to represent each table in the database you need to use in the queries. Once you have created your view objects with their correct SQL queries, you need to specify how they are related. Example:
RootView is all elements with ParentId of null.
OtherView is all elements with ParentId not null.
RootToOtherLink is a view link which links RootView.Id to OtherView.ParentId. You can specify this in the dialog. You will want to select all accessors available to make your life easier later, but make sure to name them something you will recognize, like "RootToOtherDestination".
You will also need OtherToOther Link which links OtherView.Id to OtherView.ParentId. This starts the recursive nature of the hierarchical relationship.
Once you have this set up, you will need to create an Application Module so that you have a data control you can bind your tree to. Set up the data model in a hierarchical fashion using your link.
This will create a data control on the Data Controls pane you can drag onto your .jspx page. A menu will show up from which you can select tree component. This will take you to the tree binding dialog. Here is where all your work so far will pay off. You want to click the green plus button to add your RootView. Then, with the RootView selected you will want to hit the green plus again to select your destination accessor, such as "RootToOtherDestination" as mentioned earlier. This will show the OtherView as a child of the RootView. Finally, with OtherView selected you will want to hit the green plus again and select your other destination accessor, such as "OtherToOtherDestination". Select the attributes you want to have available to your tree at the bottom of the dialog and click ok.
Your tree will show up. If you want to customize the way it looks or especially the attributes it displays in a node, those can be edited in the <af:tree> tag on your .jspx page.

Similar Messages

  • Use of tree component as menu

    hi..
    i want to use tree component which will work as menu.Like it should give options and when we choose one option it should show dialogue box with required functionalities.Please suggest me how to implement it in Javafx

    Then make use of some variable as count,it should count no of files stored in some place ( the place where he can delete as you said?) , if the count is less than or equal to 1, then enable the upload file UI element other wise disable it.
    Regards
    Srinivas
    Edited by: sanasrinivas on Feb 4, 2012 10:22 AM

  • Using the Tree component of ADF

    Hi!
    I am wondering if someone could show me a small example of a tree component with pre-defined columns.
    Thank you in advance for your assistance!

    Would you be able to provide an example or a couple of links to resources about how to do so?
    I've looked at http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_table.htm#CIADBJCJ, but it doesn't quite explain enough for me.
    The example of a treemodel provided there is:
    List<TreeNode> root = new ArrayList<TreeNode>();
    for(int i = 0; i < firstLevelSize; i++)
      List<TreeNode> level1 = new ArrayList<TreeNode>();
      for(int j = 0; j < i; j++)
        List<TreeNode> level2 = new ArrayList<TreeNode>();
        for(int k=0; k<j; k++)
          TreeNode z = new TreeNode(null, _nodeVal(i,j,k)); 
          level2.add(z);
        TreeNode c = new TreeNode(level2, _nodeVal(i,j));
        level1.add(c);
      TreeNode n = new TreeNode(level1, _nodeVal(i));
      root.add(n);
    ChildPropertyTreeModel model = new ChildPropertyTreeModel(root, "children");
    private String _nodeVal(Integer... args)
      StringBuilder s = new StringBuilder();
      for(Integer i : args)
        s.append(i);
      return s.toString();
    }Is a TreeNode a custom class that contains the fields for the tree?

  • Urgent ..How to use Tree component in a web based interface

    I want to make a Java web based windows explorer type interface.
    For that i want to use tree component .
    Is it possible for me to do this.
    Can anybody suggest me how to do ?

    Hi,
    I assume you plan to do this in a browser and you plan to use JTree. When using an applet, you'd have to make sure that the latest Java Plug-In is available on the client.
    If you not plan to use JTree, you could use a Tree component which is not based on swing such as the one at http://www.calcom.de/eng/dev/cctree.htm
    In this case still the browser would have to be 'Java enabled' by any kind of plug-in
    Ulrich

  • Custom icon per entry in the AS2 Tree Component (using CS3)

    I have a tree component that loads its data from an XML file and I wonder if I can customize every entry to have its own icon by adding an icon attribute to every entry in the XML and giving the tree an action to read that icon (which would exist in the library of the Flash file). My goal is to reproduce a tree within an application that my company is developing (it's for a training tool related to that application).
    My XML says something like <node label = 'Label' heading = 'LABEL' desc = 'Description' icon = 'icon1' />
    My label is what the tree displays, the heading is what the information dialog in the training tool displays as a title bar, the desc is what the training tool displays within the body of the text for the function description and the icon is what I want to be a reference to the graphic in the library to place as an icon in front of the item rather than use setStyle with the properties for disclosure, leaf, and folder icons.
    Is that possible? I haven't found a solution for it yet.

    I've never used the Tree component, so I'm just guessing here....
    There is a slight delay before the xml file loads and your tree has its data provider.
    Perhaps during that time there is no node at mTree.getTreeNodeAt(0) to open? Try adding this just before the last line of your code:
    trace("the node is: "+mTree.getTreeNodeAt(0));
    What do you get?
    You might need to move that code inside the xml's load event handler.
    Another thing is that the Flash components tend to work on an invalidate-then-wait-one-frame-to-redraw kind of model. So it is possible you will need to wait one frame after the xml has loaded and then tell it to open that node.
    The doLater method might help with that.
    var home:MovieClip=this;
    var xmlTreeData:XML = new XML();
    xmlTreeData.onLoad = function() {
    mTree.dataProvider = this.firstChild;
    mTree.doLater(home,"delay");
    xmlTreeData.ignoreWhite = true;
    xmlTreeData.load("xml/treeValues1.xml");
    mTree.setStyle("fontSize","11");
    mTree.setStyle("selectionColor","0xE0E0E0");
    mTree.setStyle("useRollOver",false);
    function delay(){ 

  • Tree Component Icons

    I'm using the tree component for a little Windows Parody I'm making. In my .fla, There's a tree component that loads an external XML file.  I can't figure out how to add custom icons to my component, though.
    I know it's possible to set the icons for just the default folder and file icons, but since it's a Windows Parody, there'll be different icons for different file types, folder types, etc.
    In other words,  I'd like to have a different icon for every item in my Tree component.
    How can I do this? 
    Here are the contents of my XML file:
    <node>
        <node label="Desktop">
    </node>
        <node label="Documents">
    <node label="Pictures" isBranch="true" />
    <node label="Movies" isBranch="true" />
    <node label="Games" isBranch="true" />
    <node label="Video" isBranch="true" />
    </node>
        <node label="Computer">
    <node label="Local Disk (C:)" isBranch="true" />
    <node label="Local Disk (D:)" isBranch="true" />
    <node label="DVD-RAM Drive (E:)" isBranch="true" />
    <node label="DVD/CD-RW Drive (F:)" isBranch="true" />
    </node>
    <node label="Readme.txt" isBranch="true" />
    </node>
    And the code on the first frame of my .fla file.  The Tree's name is "fileTree", and the XML file is "doors_explorerXML.xml".
    //Tree
    var fileDP:XML = new XML();
    fileDP.ignoreWhite = true;
    fileDP.load("doors_explorerXML.xml");
    fileDP.onLoad = function() {
        fileTree.dataProvider = this.firstChild;
    Also, I don't need to have an XML file loaded.  If there's an easy way that does it all within Flash, please tell me.  I just need to be able to handle events from the Tree. 

    Im having the same issue. I dont know how to change the tree icons separately with the xml. Is there anyone who knows how to do it?
    This is what I got so far. However, i can only get my first branch to show custom icons. I tried ALOT, but i guess I´m doing something completely wrong.
    Here is the code for my tree so far:
    my_xml = new XML();
    my_xml.ignoreWhite = true;
    my_xml.load("tree.xml");
    my_xml.onLoad = function(){
    myTree.dataProvider = this.firstChild;
    var folders = my_xml.firstChild.firstChild;
    var docs = folders.childNodes;
    for (var i=0; i < docs.length; i++){
    currDoc = docs[i];
    trace(docs[i]);
    var docIcon = currDoc.attributes.pic;
    switch(docIcon){
    case "pdf":
    myTree.setIcon(currDoc, "pdfIcon");
    break;
    case "word":
    myTree.setIcon(currDoc, "wordIcon");
    break;
    case "excel":
    myTree.setIcon(currDoc, "excelIcon");
    break;
    case "ie":
    myTree.setIcon(currDoc, "ieIcon");
    break;
    }//switch
    } //for
    };//onLoad
    And here is the XML I used:
    <node label="» Dokument typer">
    <node label="» links - document">
    <node label="test.url" url="http://www." pic="ie" info="test text" />
    <node label="test.doc" url="test.doc" pic="word" info="test text" />
    <node label="test.excel" url="test.xls" pic="excel" info="test text" />
    <node label="test.pdf" url="test.pdf" pic="pdf" info="test text." />
    </node>
    <node label="» Links - document">
    <node label="test URL" url="http://www." pic="ie" info="test text." />
    <node label="test URL" url="http://www." pic="ie" info="test text." />
    </node>
    </node>

  • A question about the Tree Component

    I have try to use the tree component i a flash page, and
    it´s going allright until I´ll want to link the content
    to a page... WHY??
    I have tried a lot of different codes here are those I tried:
    <tree>
    <folder label="Mine own">
    <link label="My page" url="
    http://www.mickesei.se" />
    </folder>
    </tree>
    Nr2:
    <tree>
    <folder label="Mine own">
    <link label="My page" link="
    http://www.mickesei.se" />
    </folder>
    </tree>
    nr3:
    <tree>
    <folder label="Mine own">
    <link label="My page" href="
    http://www.mickesei.se" />
    </folder>
    </tree>
    nr4:
    <tree>
    <folder label="Mine own">
    <link label="My page" get URL="
    http://www.mickesei.se" />
    </folder>
    </tree>
    But nothing seems to work, when I go mouse over it still a
    arrow should it?
    HELP ME PLEASE!!! Micke

    Thanx Jeanne,
    You brought me on a idea with the UIX Developer's Guide and EXPANDABLE_EXPANDED value.
    I couldn't figure out how the expand property was filled, because it wasn't done in the ADF BC ViewObject. We have a Utility class that creates a DataObject from the ViewObject Data and here the expand property was set.
    Now it was easy to build a ExpandAll option. It is possible to access the HttpServletRequest object were the DataObject is created. By setting a attribute in the request I could react on that and give the expand property indeed the value EXPANDABLE_EXPANDED.
    Dennis

  • Tree Component Background Color

    Hi,
    I am using the Tree Component, it has 3 nodes.
    - Is there a way I could change the background color when
      I open each node.
    - Is there a way to change the font of the text
      associated to each node.
    Any Help would be appreciated.
    NAC

    Hi SAP Partner,
    What I have understood from your question is :
    1) you want to display the selected node in a different color than the rest of the nodes
    2) You need to change the text style of the tree as a whole(but not dynamically)
    If this is your requirement, you can make use of themes either in WebDynpro itself or Portal themes if you are embedding your application into portal.
    For applying webdynpro themes this link may help you
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/colourful webdynpro applications.pdf
    But I feel it is much more easier to do it from portal side if you have some portal knowledge. I cannot offer you any document saying how to do it from portal. But you might get some help from EP forum.
    Hope this helps,
    Best Regards,
    Nibu.

  • Layout issue with af:tree component

    I am using af:tree component but I am finding layout issue with it. I have a requirement where in I need the tree to stretch to the available space but a horizontal and a vertical scrollbar comes up automatically. Is there a way to handle this issue?

    User, without your jdev version it's hard to help.
    Have you embedded the tree component in a stretch layout?
    Timo

  • [F8] Tree Component: How can I hide/remove the scrollbar and border?

    I'm using the Tree Component in my Flash 8 Pro - Project. I'm
    trying to customize the look of the Tree component in two ways:
    1. Is there any way to remove the scrollbar from the Tree
    Component?
    2. Can I also remove the Border from the Tree Component?
    I checked the Component Inspector and couldn't find any
    options for the scrollbar nor the border.
    Does anyone know how to do this or could you point me in the
    right direction?
    Thanks

    You can use the Status-4-Evar extension to replace some functionality that was lost withthe removal of the Status bar in Firefox 4.
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout" after you have installed the Status-4-Evar extension and drag the items (Status Text, Progress Meter, Download Status) upon the Add-ons Bar (View > Toolbars > [X] Add-on Bar)
    * Status-4-Evar: https://addons.mozilla.org/firefox/addon/235283/

  • Questions about AS2 Tree Component (Flash CS3)

    I have Flash application with a Tree component on the Stage. I'm using an XML file to create the structure of the Tree component.
    Each entry on my XML has the attributes id, label, heading, desc, and icon.
    My problem is that I can't seem to be able to set the Tree to default with the first node open.
    My code is:
    var xmlTreeData:XML = new XML();
    xmlTreeData.onLoad = function() {
    mTree.dataProvider = this.firstChild;
    xmlTreeData.ignoreWhite = true;
    xmlTreeData.load("xml/treeValues1.xml");
    mTree.setStyle("fontSize","11");
    mTree.setStyle("selectionColor","0xE0E0E0");
    mTree.setStyle("useRollOver",false);
    mTree.setIsOpen(mTree.getTreeNodeAt(0), true);
    My tree populates fine, and the handler I retrieve whatever item is clicked works great. However, the tree refuses to default to having that first node open.
    I'm also interested in placing custom icons into certain nodes via the icon attribute I've set in the XML, but that will have to come later I guess.

    I've never used the Tree component, so I'm just guessing here....
    There is a slight delay before the xml file loads and your tree has its data provider.
    Perhaps during that time there is no node at mTree.getTreeNodeAt(0) to open? Try adding this just before the last line of your code:
    trace("the node is: "+mTree.getTreeNodeAt(0));
    What do you get?
    You might need to move that code inside the xml's load event handler.
    Another thing is that the Flash components tend to work on an invalidate-then-wait-one-frame-to-redraw kind of model. So it is possible you will need to wait one frame after the xml has loaded and then tell it to open that node.
    The doLater method might help with that.
    var home:MovieClip=this;
    var xmlTreeData:XML = new XML();
    xmlTreeData.onLoad = function() {
    mTree.dataProvider = this.firstChild;
    mTree.doLater(home,"delay");
    xmlTreeData.ignoreWhite = true;
    xmlTreeData.load("xml/treeValues1.xml");
    mTree.setStyle("fontSize","11");
    mTree.setStyle("selectionColor","0xE0E0E0");
    mTree.setStyle("useRollOver",false);
    function delay(){ 

  • Tree component display problem when text too long???

    hi all
    whenever i use a tree component to display some sort of text, i run into problems when the width of the text being display for a node is larger than the width of the tree component.
    Given: Tree tree1 with Node node1 and Child Node child1
    When the text of either node1 or child1 is longer than the width of tree1, the text is displayed on its own single line UNDERNEATH the node images. this makes the text look like it does not belong to the group of children of a given node.
    is there anyway to add maybe a text area or some sort of scrolling region to allow for any length of text for any node??
    thanks everyone!

    Yes, you can change the size of the tree node text field. Please see the "Tree Node Component Properties Window" section in the Help Contents within the IDE. Look at the info under the "Appearance" section.

  • Tree component in Flex 4

    Are there any known issues with the <mx:Tree component in Flex 4?
    We have upgraded from Flex 3 builder to Flex 4 builder. Everything works except any where we have used a tree component the data is no longer showing. Has there been a change in how to populate the Tree component? We populate the tree by setting the dataProvider with an ArrayCollection.

    @travr,
    I'm not aware of any big known issues in mx:Tree between Flex 3.x and Flex 4.x. What problems are you seeing, and can you reproduce the issue with a simple test case (if so, please post the simple test case here and we can take a look).
    This works in Flex 3.5:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
        <mx:ApplicationControlBar dock="true">
            <mx:Button id="sdkVer" initialize="sdkVer.label = mx_internal::VERSION;" click="System.setClipboard(sdkVer.label);" />
        </mx:ApplicationControlBar>
        <mx:Tree id="tr" labelField="name" width="200" x="20" y="20">
            <mx:dataProvider>
                <mx:ArrayCollection>
                    <mx:Object name="1. One">
                        <mx:children>
                            <mx:Object name="1.1 One" />
                            <mx:Object name="1.2 Two" />
                        </mx:children>
                    </mx:Object>
                    <mx:Object name="2. Two">
                        <mx:children>
                            <mx:Object name="2.1 One" />
                        </mx:children>
                    </mx:Object>
                </mx:ArrayCollection>
            </mx:dataProvider>
        </mx:Tree>
    </mx:Application>
    And this seems to work in Flex 4.5/Hero beta:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
        <s:controlBarContent>
            <s:Button id="sdkVer" initialize="sdkVer.label = mx_internal::VERSION;" click="System.setClipboard(sdkVer.label);" />
        </s:controlBarContent>
        <mx:Tree id="tr" labelField="name" width="200" x="20" y="20">
            <mx:dataProvider>
                <s:ArrayCollection>
                    <fx:Object name="1. One">
                        <fx:children>
                            <fx:Object name="1.1 One" />
                            <fx:Object name="1.2 Two" />
                        </fx:children>
                    </fx:Object>
                    <fx:Object name="2. Two">
                        <fx:children>
                            <fx:Object name="2.1 One" />
                        </fx:children>
                    </fx:Object>
                </s:ArrayCollection>
            </mx:dataProvider>
        </mx:Tree>
    </s:Application>
    Peter

  • Tree component bug

    We use a tree component on client side with several tree nodes.
    We have a tree action for them.
    It usually works fine, but randomly getCookieSelectedTreeNode() method returns null (empty string). Sometimes no error after 10 clicks, but sometimes it returns null after a few click.
    If somebody have a solution for this, please let us know.

    I have a solution for my problem now. It turns out that my issue wasn't quite the same as the original problem cited by K_Gabor.
    Our issue was machine specific and was down to the fact that getCookieSelectedTreeNode() will return null if cookies are blocked by the browser. Not really surprising given the name of the method, but it is something that should be kept in mind when using this method.
    Given that cookies are frequently blocked, is there an alternative method for getting the selected node that doesn't rely on cookies?
    Cheers,
    Chris.

  • Customizing tree component

    hi
    i would like to know if it's possible to use a tree component, where each node is more than the simple default static text component.
    ideally, i'd like a tree to dynamically create a node for each Order in a database. each Order Node would have sub-nodes for each item of that order. this can be done by following the tree component tutorials.
    but what i need is to be able to add other components to the nodes, other than the default static text. for example, adding a table to a node, or a text area. whenever i try to do this, the IDE adds the components to the nodes but aligns them with the left-most border of the entire tree component, instead of aligning them with the left border of the node to which they belong.
    what can i do?

    thank you very much. it works!!
    my only problem occurs when the text being set for a node is too long. the tree component displays the text on a single line OUTSIDE of the tree node ie. the start of the text is aligned on the left with the tree title instead of being under the node it is supposed to be in.
    thanks again!!

Maybe you are looking for

  • All-in-one Printer (Suggestions)

    I am looking for a printer, scanner, copier ($100 price range) that works under Arch.  I have found that the HP Officejet 5610 (http://www.linux.com/articles/114181) works under linux, but I wanted to see if there were any success stories with people

  • Business rules in 11.1.1.3 execute more than once

    My client has the situation where certain business rules (launched from the Planning BR interface) will execute more than once, sometimes twice or even three times. It seems that the rule will start to execute and then after 1 or two minutes, will la

  • Reg Mass maintenance in Material master

    Dear Gurus,                        I have uploaded HALB material wth movng avg price by mistake....I want to change it to std price in accounting view. Kindly guide me how to change it as standard price.

  • Tunning EPM apps and configuration (EPM 11.1.2.3)

    Hi All,        Does anyone knows where I can find some information about tunning applications (Essbase and Planning), and some information about how to optimize the apps with configuration for EPM 11.1.2.3 ? Thanks in advance,

  • Convergence - Using External Accounts with POP/SSL

    Using Convergence v. 1.0-10.01 I'm trying to use the External Accounts feature of Convergence for a POP account requiring SSL. The POP logs on the Sun messaging server hosting the external account show: 20090930 154527 /opt/SUNWmsgsr/config/PopProxyA