Drill up broken in a tree based on a union

Situation: there are six real root rows in the table and they have 0 in the parent id, so I added a single root to the tree select statement:
UNION
SELECT 0 id, NULL pid, 'Root' name, null link, null a1, null a2 FROM DUAL
The whole tree displays ok starting from "Root" if I set the tree root item value to 0. The nodes have drill down links that make the selected node the new root. When you do that, the new root shows an "up" link that lets you drill up again, except that the six actual root nodes never show it so you can't drill back up to "Root" after drilling down (or setting the initial root item value to other than 0). Questions:
What could be going wrong?
Is there any even a little better documentation on trees than in User's Guide "Creating Trees"?
What exactly is the logic determining whether the drill up link is shown or not? It seemed to be: if the current root has any parents in the select stmt result set, show it. Not in this case though.
Is there a way to see the actual select statement that was executed to generate the tree?

Hi,
I don't know why this is, but the problem is because you are using 0 as the pseudo root ID. I've just been trying this out and found that if I changed this to 1, then the (up) link appears ok. It is possible that null values are being treated as zeros because most ID values will be greater than 0.
For simplicity, I also created a view over my EMP data as:
CREATE OR REPLACE FORCE VIEW "TREEDATA"
(ID, PID, NAME)
AS
SELECT 1 ID,
       NULL PID,
       'Root' NAME
FROM DUAL
UNION
select EMPNO ID,
       CASE WHEN MGR IS NULL THEN 1 ELSE MGR END PID,
       ENAME NAME
from EMPand the tree was then defined as:
select ID,
       PID,
       NAME,
       'f?p='||:APP_ID||':125:'||:SESSION||'::NO::P125_TREE_ROOT:'||ID LINK,
       null A1,
       null A2
from TREEDATA
ORDER BY NAMEThe default on the P125_TREE_ROOT item was set to 1 (Only when current value in session state is null).
I have not seen any other documentation - I'm sure it's out there somewhere, perhaps in the upcoming Pro Oracle Application Express book or a blog.
Andy

Similar Messages

  • How to create dynamic tree based on BAPI

    Hi
    I am able to create dynamic tree based on flat file structure example given in SDN . But how to create the tree from BAPI directly.Also when I will be clicking on any leaf node of the tree some data related to the node will be passed to another view.
    Regards
    Ananda

    What i'm trying to do is create an organizational structure.
    Global>Region>Plant-->Corporation
    The output from the RFC is a structure containing every possible combination for orgazational hierarchy. Basically a flat table with record for every possible combinaton of Region-Plant-Corporation. This data needs to be bound to a tree structure so that we can call BW queries based on that level. For example: Give me aged inventory for the SAP corporation within the plant Berlin that is located in the Europe region.
    Now that you understand the business reason will the nodes that represent Region and Plant and corporation be non-singleton nodes or recursive? I was thinking a hierarchy of non-singleton nodes.
    I can bind these nodes to the Region - Plant - Corporation elements returned from in the flat table structure. I will probably get duplicates as a specific Region will be listed multiple times for every possible combination of the data beneath it. I'm not so concerned about that right now as I want to make sure I understand how in Web Dynpro to bind the data to the tree.
    Hopefully this makes some sense. Can you elaborate on how this may be constructed in context of the view?
    Would i create a model node for region (0..n), model node for plant (0..n), and a model node for Corporation (0..n)?
    Or does this sound totally incorrect?
    julian
    We have 3 regions over 50 plants and probably around 500 corporations.

  • Tree based on XML DB files

    Has someone ever tried to build a tree based on XML DB files?
    Regards,
    Learco

    Hello,
    Yeah I've done that before, I basically was getting XML exports and was running them against one of 3 XSLT's , users choice , and one was a tree. I'll dig up the code.
    Or are you talking about building a tree based on all the files in XMLDB to navigate around them, I have a start on that I can give you as well, never finished it though.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Tree based on class CL_GUI_COLUMN_TREE.

    Hi,
    i use a tree based on class CL_GUI_COLUMN_TREE.
    Now i wish to adjust the column width of  the first hierarchy column. It doesnt work with method "ADJUST_COLUMN_WIDTH" because is it a hierarchy column.  Is there any other method? or how i must fill the "exporting" hierarchy_header when i create the object?
    Stefan

    I'm showing that I do this using the hierarch_header when creating the object in one of my programs.
    data:  hierarchy_header type treev_hhdr.
    * Setup the hierarchy header
        hierarchy_header-heading = 'Transactions'.
        hierarchy_header-width   = 30.    "<<--  Set the width
    * Create a tree control
        create object tree
          exporting
            parent                = container
            node_selection_mode   = tree->node_sel_mode_single
            item_selection        = ' '
            hierarchy_column_name = 'Column1'
            hierarchy_header      = hierarchy_header       <<---  Right here
         exceptions
            others                      = 7.
    Regards,
    Rich Heilman

  • Hierarchical tree based on columns in the same row

    Hi guys,
    I have the following table:
    TABLE A:
    COL1 COL2 COL3 COL4
    1 2 5 8
    1 2 6 9
    1 3 1 3
    1 4 2 4
    ... then, as I have ordered the info, I want to implement a tree based on every row of my table.
    Could you help me with the procedure please??
    Thanks.

    REPOST

  • How to create a tree based on directory structure

    I want to create a hierarchical tree in Forms 6i based upon a file system directory structure (similar to Windows Explorer). How can I populate a tree with this information, is there something that I can call or write that would return the file system structure in a format that I can populate my tree?
    Any advice would be greatly appreciated.
    Thanks
    Richard

    Your link does not seem to work.They're re-jigging all the links to accomodate the hot poop on Oracle's latest and greatest, 10G. So at least the website is on schedule even if the actual software delivery dates have slipped :P
    We can still get D2KWUTIL from here: http://te chnet.oracle.com/software/products/forms/content.html
    Cheers, APC

  • Tree based on ViewObject with bindparams

    Hi,
    We have some pages that are tree-form based; the tree and the form and based on two different viewobject usages, but the same viewobject. This VO uses a bind parameter to limit the data. With JHeadstart we can provide this bindparameter with the group, but it seems that it generates a methodbinding and invokeaction only for the form and not for the tree and we have to add these after generation. Is there a way that we can generate these for both the tree and the form?
    Is this intended behaviour or can we request it as an enhancement?
    Fortunately in some cases can we use the same viewobjectusage for both the tree and the form and then it works out fine, but this is not possible for all the pages.
    Ciao
    Aino

    Aino,
    It is intended behavior, although I agree that we could apply the same bind params to the tree vo usage when it is based on the same VO. But a real solution is to add an additional group property: Tree Query Bind Parameters, as this also solves the case where the Tree Vo usage is based on a different VO. I have added this to the list of enhancements.
    Steven Davelaar,
    JHeadstart Team.

  • Display the part of table tree based on input parameter

    Hi,
    I have the use case where I have to display the tree table based on the input parameter.This input parameter will display the displaying the node of tree which are under the given input node id.
    so If given node id is 10 then we should to display the node which are under 10.rest should not get displayed.
    Can you tell me how it can be achieved using ADF.
    I am using jdev 11.
    Thanks,
    Harsh

    This depends on how you apply the VC to the VO at runtime. Easiest way to accomplish this would be to create a VO in the data model of the application module which you edit in the data model to already having the vc applied to.
    In your region you can then drag the 'executeWithParameters' method onto the task flow and make it the default activity. Here you map the input parameter of hte task flow to the parameter needed for the executeWithParameter.
    For hte method you get a binding like
        <action IterBinding="EmployeesByNameIterator" id="ExecuteWithParams" RequiresUpdateModel="true" Action="executeWithParams">
          <NamedData NDName="bindLastName" NDValue="#{pageFlowScope.pname}" NDType="java.lang.String"/>
        </action>
    NDValue="#{pageFlowScope.pname}"
    is the inputParameter from the region (or task flow).
    Timo

  • Populating the tree based on the XML datasource

    We have a XML document that contains the required information regarding tree hierarchy.
    We would like to use this XML document as a datasource for the ADF tree/treeTable component.
    Can you please provide pointers for achieveing the same?
    Thanks in Advance,
    Navaneeth

    Two options are the URL Data Control: http://www.oracle.com/technetwork/developer-tools/jdev/urldatacontrol-099677.html
    or using JAXB with TopLink/EclipseLink to create Java objects that map to the XML and then exposing those as data controls.

  • Lead selection with a tree-based table.

    I've created a recursive context node to display contents of a KM folder.  The structure has been mapped to a table, which works just fine.  I can expand nodes of the tree and display the contents of sub-folders.  Great.  However, I need to know which backing KM object has been selected via the table.  Since this is a recursive structure, using
    wdContext.currentXXXX()
    does not work, since that's the top of the tree.  Parameter mapping will only give you the column and/or row of the item selected in the table, not the object itself.
    I'm missing something obvious here, but I can't figure out how to get the context element behind the selected row in a table which is displaying a recursive structure.
    I can do this with a Tree structure, since you can map the 'path' parameter to the actual context object.  However, the Table UI doesn't offset that information (a severe oversight, at least in my mind).
    Suggestions?

    Thanks Armin, that works great.
    Had I finished reading this page:
    http://help.sap.com/saphelp_nw70/helpdata/en/60/1f1f056f057d4d962375efd3c92ed0/frameset.htm
    I would have found the correct documentation.

  • Tree based on Record Group

    Hi guys i have a tree that i populate using
    FTREE.Set_Tree_Property(tree_item, FTREE.RECORD_GROUP, rg_Tree_Id);     The problem is that my query is fine but the parent child relationships are not working.
    The help on forms is terrible for trees and i cant find any information anywhere else.
    As anyone any example of how this works?
    my record group contains data such as this
    child level     parent
    203096     1     203094          
    203097     1     203094          
    203098     1     203094          
    203099     1     203094          
    203100     1     203094          
    203101     1     203094          
    203102     1     203094          
    203103     1     203094          
    203104     2     203096          
    203105     2     203096          
    203106     2     203096          
    203107     2     203096          
    203108     3     203107          
    203109     4     203108          on displaying the tree the tree displays with all the information but the branches are in the order as above, they do not branch off the correct parent i.e. 203104 should branch off 203096 but it doesnt it branches off 203103 as this is the one above it, and the level is the only thing that has changed.
    any ideas?

    Hai,
    In Tree, the values should be in the order.
    that means,
    parant 1 - 100000
    child 1 100001
    child 2 100002
    parant 2 200000
    child 1 200001
    like that.
    Regards,
    Manu.

  • N level tree based on PL/SQL procedure

    Hi everyone,
    I want to display a tree of n levels of employees (n is not known in advance) :
    Root(Boss)
    | Employee1
    | Employee11
    ......... | Employee1NN...
    | Employee12
    | EmployeeN
    .....| EmployeeNN..
    The problem is that I don't have access to tables containing the employees. For each employee I get the "sub-employees" list by calling a PL/SQL stored procedure getEmployees(masterEmployeeName).
    So is there a way in ApEx to create a n level and sublevel tree, each level corresponding to a PL/SQL procedure ?
    Best regards,
    Othman.

    Hi Othman,
    I haven't tried this for a while, the last time I had to do anything like this was to construct a folder structure starting from a root folder.
    Assuming that you can retrieve ID's and employee names in your function, the principle would be something like:
    1 - Create two collections - one for the Tree (to hold ID, Name and Parent ID) and one to hold a list of Employee IDs
    2 - Into the Tree collection, create a new member and insert 0, Root, null (Where 0 is the ID for the top boss and Root is whatever name you need to give this), into c001, c002 and c003
    3 - Into the Employee collection, create a new member and insert 0 into column c001
    4 - Now create a loop to run while the Employee collection contains at least one member
    5 - In the loop:
    5 A) Get the value from c001 in the first member in the collection (this will be the "Parent ID")
    5 B) run your function to retrieve a list of employees relating to that Parent ID, if any
    5 C) Loop through the list and insert a member into the Tree collection: ID, Name, Parent ID and insert the employee's ID into the Employee collection
    5 D) Delete the first member from the Employee collection and resequence the collection (to give you a new member number 1)
    6 - Eventually, you will have no members left in the Employee Collection - your loop should terminate
    7 - You should now have a complete structure in the Tree collection which can be used on the page
    Regards
    Andy

  • Flex MX:TREE based on GroupingCollection2 datasource?

    I have an ArrayCollection that consists of VO objects derived from a database query. I have grouped this collection of objects using the GroupingCollection2 object, but cannot for the life of me figure out how to bind it correctly to my tree control. It only displays [object GrouingCollection2] in the tree container, but not the objects contained within the GroupingCollection2 object. Any idea on what I might be doing wrong?
    Thanks!

    Also, you can fetch the grouped data from GroupingCollection and assign that to the Tree control. For example -
             <mx:Script>
              <![CDATA[
                   protected function button1_clickHandler(event:MouseEvent):void
                                gc.refresh();
                                tree.dataProvider = gc.getRoot();
              ]]>
         </mx:Script>
         <mx:GroupingCollection2 id="gc">
              <mx:source>
                   <mx:ArrayCollection>
                        <mx:Object day="1" hour="1" Skill0="1"/>
                        <mx:Object day="1" hour="2" Skill0="1.5"/>
                        <mx:Object day="1" hour="3" Skill0=".25"/>
                   </mx:ArrayCollection>
              </mx:source>
              <mx:grouping>
                   <mx:Grouping label="day">
                        <mx:GroupingField name="day" />
                   </mx:Grouping>
              </mx:grouping>
         </mx:GroupingCollection2>
         <mx:Tree labelField="day" id="tree" width="200" />
         <mx:Button label="Group" click="button1_clickHandler(event)" />

  • OHW Top-Level entry in tree-based TOC navigator

    Hi Team,
    Is it possible to specify the text string in the "Top Level" location? We would prefer to have our product name rather than the words "Top Level".
    We are combining multiple helpsets through a master helpset file. The <title> string from each subhelpset establishes the second-level TOC entries. Our html <title>s establish the rest of the TOC entries.
    We are using:
    <parameters>
    <combineBooks>false</combineBooks>
    <useLabelInfo>true</useLabelInfo>
    </parameters>

    Currently, there is no mechanism to change the text for the "Top Level" node.
    One thing we might do for the future would allow users to specify their own resource bundles for OHW UI, or provide some means for untranslated text to be displayed for this.

  • How to create a report based on the selection of a node of a tree

    Hello,
    I am new to Oracle Apex and I was trying to build a tree and also an interactive report based on the empno column of the emp table.
    I have created a tree based on emp table. Now I want to display records of the employee selected in the tree.
    Here is the tree query:
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "ENAME" as title,
    null as icon,
    "EMPNO" as value,
    null as tooltip,
    null as link
    from "#OWNER#"."EMP"
    start with "MGR" is null
    connect by prior "EMPNO" = "MGR"
    order siblings by "ENAME"
    Can anyone tell me step by step how to go from here?
    I tried to follow the thread Re: tree question but could not understand much from it.

    The approach for reloading the page and displaying the report is quite simple.
    <li>You start by creating a new page item which would be used to store the selected node ID , eg. P100_SELECTED_NODE (you can make it atext item and change it hidden once everything works as expected)
    <li>Modify the tree query and change the link column in the tree definition SQL query to a link to the same
    for example if your page is 100 , you would make the tree node link to the same page but set the P100SELECTED_NODE with selected node's id_
    This done here
    {message:id=4410987}
    In this case it would be
    'f?p=&APP_ID.:100:'||:APP_SESSION||'::::P100_SELECTED_NODE:'||EMPNO as link Now when you click on a tree node link , it would come back to the same page, but set the P100_SELECTED_NODE with the empno of the clicked node.
    <li> All that is left to do, is changing your Report so that it refers to the new item inorder to filter the records for this employee i.e empno
    SELECT ...
    WHERE empno= :P100_SELECTED_NODE

Maybe you are looking for