Implementing 3 level tree in Apex

Hi Friends,
I am trying to create a tree in apex. I am having 3 tables.
1.Client
2.Location
3.Device. I am having an materialized view "device_detail_view" with columns "device_id","location_id","client_id". This
Mview is having the "location_id" and the "client_id" for all devices. The corresponding client_name and location_name
is stored in the tables "client" and "Location". I want a tree in which the "Client_name" will be the root node. When
clicking on the client names all "location_name " assosiated with that need to be displayed. When clicking on a specific
"location_name" all "device_name" assossiated with that device must be displayed.How can i achieve this. Any input will
be appreciated.
Regards,
Jyothi

Hi Hilary,
Your example was just so wonderful.I have a question.My tree works well.I have a requirement to show my link page at the same page with my tree.How can I do that?
For example I have
'View' as tooltip,
case when link_type = 'M'
then 'f?p='||:APP_ID||':3:'||:APP_SESSION||'::NO:RIR'
when link_type = 'C'
then 'f?p='||:APP_ID||':3:'||:APP_SESSION||'::NO:CIR:IR_CATEGORY:'
||name
when link_type = 'P'
then 'f?p='||:APP_ID||':6:'||:APP_SESSION||'::NO::P6_PRODUCT_ID:'
||sub_id
how can I redirect these pages to my tree page?
Thank you in advance

Similar Messages

  • Tree using APEX 2.2

    Hi
    I have created a tree using APEX 2.2 and the wizard provided. The select for my tree is:
    select "NODE_PRIMARY_KEY" id,
    "NODE_FOREIGN_KEY" pid,
    CASE
    WHEN NODE_PRIMARY_KEY = :P6_SELECTED_PK THEN
    '<span style="color:white;background-color:#0000CD;">'|| NODE_LABEL||'</span>'
    ELSE
    NODE_LABEL
    END AS NAME,
    'f?p=&APP_ID.:6:&SESSION.::NO::P6_SELECTED_PK:'||"NODE_PRIMARY_KEY" link,
    NULL a1,
    null a2
    from "ADFY"."RRD_TREE_HIERARCHY"
    ORDER BY 1
    The above also highlights the current selected node. With a small data set the tree worked fine. Now that I have 'proper' data the tree's performance is not acceptable. I think the problem is due to the tree refreshing itself each time a node is selected. Is there anything that I can implement to stop this or to improve the performance of the tree?
    I have tried the 'Tree with AJAX' example but couldn't really get it to work.
    Thanks
    Paul

    Hi PARS,
    Try the below query, I tried to run your query in SQL command and got the same error. I corrected your query, now its running in SQL Command,
    select case when connect_by_isleaf = 1 then 0
                                                  when level = 1             then 1
                                               else                           -1end as status,
    level,
          apex_item.checkbox(1,empno,'')||ename as title,
           NULL as icon,
           EMPNO as value,
           null as tooltip,
           NULL as link
    from "EMP"
    start with "MGR" is null
    connect by prior "EMPNO" = "MGR"
    order siblings by "ENAME"
    Hope It will work...I too referred that link you shared for this. But I am not sure we can use checkbox in tree report. Because we don't have any option to change the column 'display as' like 'standard report column'. then only it will show like checkbox else it will show the code like '<input type="checkbox" name="f01" value="7839" />KING'.
    Thanks
    Lakshmi

  • Anyone knows how to implement Decomposition Tree in Oracle BI products? to

    Hello Everybody
    Recently I'm trying to use Oracle BIEE plus to upgrade our old report service in our product. I'm a newbee to OracleBI products but I have a question that oracle support guys in our region also could figure out a clear answer. If anybody here can give me some clues it would be appreciated.
    I once used ProClarity BI product before, and ProClarity report service can provide a very powerful visualization tool like Decomposition Tree. I'm quite interested this function. But I searched many Oracle BIEE plus and ESSBASE documents, it seems Oracle BI can' implements the functional for which Proclrity Decomposition Tree can provided?
    Is there any body knows any other solution to implement Decomposition Tree in Oracle BI product?
    Thanks

    Appreciated the quick response:)
    Yes. I don't find the directory object .. I'm not very familiar with biee so far so might be me slight this object in my investigation.
    I need to check this object and see how it works.
    And thanks for your advise.

  • Trees in Apex 4.0

    Hello,
    Is it possible to make the ajax tree in Apex 4.0 to "memorize" it's state between page loads ?
    Now it's always returned to it's original state after page reload, for example a folder is closed.
    Tiina

    Hi Tiina,
    If you wish to save the state of your tree, to expand the tree to the last selected node, you will need to use the 'Selected Node Page Item' attribute of your tree. Edit your tree and on the Tree Attributes page, set the 'Selected Node Page Item' to a page or application item that you wish to hold the selected node value e.g. P21_SELECTED_NODE as used in the Tree demonstration. Then update the link parameter in your tree query to set this item to the VALUE parameter of your query .e.g EMPNO. Now when you select a node, and return to the tree page, the tree will expand to that last selected node.
    You may find it useful to refer to a related thread on this topic: Re: tree question
    Regards,
    Hilary

  • Error when running a JHeadstart generated two-level tree display

    Dear All,
    I have a simple master detail VO/VO datamodel based on which I'd like to generate a two-level tree display. I've followed the JHeadstart dev guide meticulously.
    When I run the page I get an error:
    javax.faces.el.PropertyNotFoundException: Error getting property 'name' from bean of type oracle.jbo.uicli.binding.JUCtrlHierTypeBinding
    It turns out that this generated code in a region file is the root cause:
    <af:switcher facetName="#{node.hierType.name}">
    <!-- DEBUG:BEGIN:TREE_NODE : default/misc/tree/treeNode.vm, nesting level: 2 -->
    <f:facet name="MutatieSoortTypenNode">
    <af:outputText value="#{node.Omschrijving}"/> </f:facet>
    <!-- DEBUG:END:TREE_NODE : default/misc/tree/treeNode.vm, nesting level: 2-->
    <!-- DEBUG:BEGIN:TREE_NODE : default/misc/tree/treeNode.vm, nesting level: 2 -->
    <f:facet name="MutatieSoortenBijTypeNode">
    <af:outputText value="#{node.Omschrijving}"/> </f:facet>
    <!-- DEBUG:END:TREE_NODE : default/misc/tree/treeNode.vm, nesting level: 2-->
    </af:switcher>
    When I substituted the <af:switcher> .... </af:switcher> xml code by <af:outputText value="#{node.Omschrijving}"/>, the page displayed correctly.
    Given the fact that the code is generated, there doesn't seem to be much that I can do about it.
    We're using JDeveloper version 10.1.3.3.0 and JHeadstart version 10.1.3.2.41.
    Any help or suggestion would be much appreciated.
    Kind regards,
    Ibrahim

    Ibrahim,
    I cannot reproduce this. You are using a non-production build. Can you upgrade to JHeadstart 10.1.3.2.52?
    If the problem persists, you can work around it by creating a custom template for tree.vm which includes the af:switcher statement.
    Steven Davelaar,
    JHeadstart team.

  • How to associate different images at non-leaf level and leaf-level tree ?

    Hi,
    I am implementing a tree in OAF where it is required to display the associated image at non-leaf node as a folder and at leaf nodes
    a different image has to be displayed. By default Framework displays non-leaf nodes having folder as associated image and leaf nodes with
    no image associated. When I associate image at parent node then all the nodes irrespective of being leaf or non-leaf have the same
    image associated with them.
    How to keep the folder as associated image for non-leaf node and a custom image at leaf nodes? Pls. help.
    Thanks in advance

    The leaf node I am referring to here is just the last node in the tree hierarchy consisting of only one view link and VO. I have just
    a simple parent child hierarchy. ex: Mangaer/Employee relation with the emloyee who have no reportees under them
    should contain a image against their name display in the tree and other employees should have a folder against their name display in the tree.
    Thanks
    Avinash

  • Has anyone created a dynamic two or three level tree?

    Hi -
    If anyone has created a dynamic two or three level tree, can you please explain and/or show a code example of how you did it? The 'dynamic tree tutorial' doesn't show the child node being created dynamically, but graphically.
    I can build the first level fine, but how does the child node get associated with the parent node in the next level?
    Thanks in advance.

    Here's a snippet that might help. I'm sure there are more elegant ways to code it but this seems to work!
    Good luck,
    Keith
    //1st Loop - executed once per first level of tree
    for (int i = 0; i <= days; i++) {
    j = i+1;
    TreeNode newFirstNode = new TreeNode();
    newFirstNode.setId("day" + j);
    newFirstNode.setText("First " + j );
    itineraryNodeChildren.add(newFirstNode);
    java.util.List firstNodeChildren = newFirstNode.getChildren();
    // Second Loop executed once per Second level within the First loop
    for (int k=0; k<rk; k++) {
    secondNumber ++;
    TreeNode newSecondNode = new TreeNode();
    newSecondNode.setText(secondNodeText);
    firstNodeChildren.add(newSecondNode);
    }

  • What might cause 3 level tree to fail?

    hi,
    there are VO1,VO2,VO3.Each one has id and name fields.
    i try to build a 3-level tree: VO1 is parent to VO2 which is parent to VO3
    it's supposed to be a tree containing all elements of VO1 on the upper level, each leaf of which should contain all elements of VO2 etc
    in order to ensure cartesian join i created a column lvl1 with value 1, and lvl2 with value 2.
    then i created 2 view links between each pair: VO1 and VO2 are linked by lvl1, VO2 and VO3 are linked by lvl2.
    any 2 level trees are showing ok in all combinations (between VO1/VO2, VO2/VO3)
    but when i define 3 levels in tree level binding , application fails with error: (tree is kept in a region)
    <UIXRegion> <_warn> Error handling viewId: /QueueAction URI: /QueueAction.jspx actual-URI: /setup.jsff.
    java.lang.IllegalStateException: ADFv: Not inside container.
    i follow http://andrejusb.blogspot.ru/2011/12/tuning-adf-tree-retain-view-link.html
    JDev 11.1.2.3

    blog helped

  • Creating dynamic tree in Apex 4.0

    Hi Friends,
    I am trying to display the "sites" and "devices" under that site in a tree. THe site is the first level in the tree. But under a site there will be some 20-30 devices. I want to display the first 10 devices when clicking on the '+' in a site and a 'more' link after the 10th device. By clicking the 'more' link ,display the next 10 devices and so on. Is there any way to achieve this in Apex 4.0. Please help
    Regards,
    Jyothi
    Edited by: Jyothi on Jan 9, 2011 3:28 AM

    Hi Vee,
    Sorry for the late reply. I need exactly the same
    do you want to add a 'more link' in place of all 2nd level children in your tree for 1st level node having more than 10 children under it ?
    If there is 25 nodes i need to display the first 10 nodes and there is a more link in the last part. when clicking on the "more" link the next 10 nodes but with an additional "back" link in the top like
    a..|-*back*
       |- a11
       |- a12
       |- a13
       |- a14
       |- a15
       |- a16
       |- a17
       |- a18
       |- a19
       |- a20
       *more*when clicking on the back link the node part must dislay the last 10 nodes like.
    a..|-a1
       |- a2
       |- a3
       |- a4
       |- a5
       |- a6
       |- a7
       |- a8
       |- a9
       |- a10
       *more*When clicking the "more" button will display the next 10 nodes with a "back" link like.
    a..|-*back*
       |- a21
       |- a22
       |- a23
       |- a24
       |- a25
    If thge no: of nodes is less than 10 only "back" link is needed. Am i confusing you?
    Please help.
    Thanks,
    Jyothi
    Edited by: Jyothi on Jan 9, 2011 3:27 AM

  • Implementing Search Filed in apex 4.1

    Hi All,
    I am new to APEX
    I have an application, which is based on SQL query. For that apllication i want implement a search function based on particular column.
    For Ex: I have name column in the application, So in the search text filed when i any type a string present in name column it should redirect me to the same page by filtering the records on that search criteria
    when the criteria matches
    else if it doesn't matches the search criteria appropriate message "not found" should be displayed.
    the report i have for this is classic report.
    Please anybody guide me on this as i need this on urgent basis.
    Thanks

    Hi,
    This is my code
    select * From (
    select
    apex_item.checkbox(21,'#ROWNUM#','UNCHECKED') " " ,
    APEX_ITEM.HIDDEN(1,ptr.row_id)||APEX_ITEM.text(22,ptr.country_code||'-'||ptr.name) partner,
    ptr.row_id,
    ptr.country_code,
    cmp.country_description,
    ptr.name,
    ptr.gsrt_category,
    ptr.gcm_ptr_category,
    APEX_ITEM.TEXT(19,ptr.opn_number_esrt,5) opn_number_esrt,
    ptr.company_id,
    count(ptr.emea_category),
    apex_item.select_list_from_query(23,ptr.emea_category, 'select category_description,category from fridge_esrt_ptnr_cat_mst') cat,
    apex_item.select_list_from_query(24,ptr.partner_group, 'select partner_group,group_id from APEX_SRT_PTNR_GROUP') partner_group,
    apex_item.select_list(25,ptr.global_isv,'Y;Y,N;N') global_isv_flg,
    apex_item.select_list(26,ptr.specialised_partner,'Y;Y,N;N') specialised_partner_flg,
    apex_item.select_list(27,ptr.opn_membership_level,'Diamond;Diamond,Platinum;Platinum,Gold;Gold,Silver;Silver,Remarketer;Remarketer') opn_membership_level,
    apex_item.select_list(28,ptr.high_impact_stl,'High Impact Partner;High Impact Partner,Managed Partner;Managed Partner,Partner STL;Partner STL') high_imp_ptr,
    apex_item.select_list(29,ptr.managed_ptr,'Strategic;Strategic,Managed Partner;Managed Partner,Investment;Investment') managed_ptr_flg,
    apex_item.select_list(30,ptr.we_apps_type,'Transformational,Best-in-Class,C-Level') we_apps_type,
    apex_item.select_list(31,ptr.isv_ready_status,'Y;Y,N;N') ptr_stl_account,
    round(sum(srt.cd_sum/1000),4) cd_sum
    from apex_srt_partner ptr
    left outer join apex_ptr_revenue_a srt on ptr.name = srt.partner_name and substr(ptr.country,1,3) = srt.country_code
    left outer join oxo_cube.l_company_d cmp on srt.country_code = cmp.country_code
    where
    cd_sum>0 and ptr.emea_category <>'DIR' and
    ptr.country_code in(select country_code from ept_sec_apex_data_vis where upper(trim(user_email))=upper(trim(:APP_USER)))
    and
    (case when :P1_CATEGORIES is null then 'X'
    else emea_category end) = nvl(:P1_CATEGORIES, 'X')
    and
    (case when :P1_PNAME is null then 'X'
    else name end) like '%'||upper(:p1_pname)||'%'
    and
    (case when :P1_COUNTRY is null then 'X'
    else cmp.country_code end)  = nvl(:P1_COUNTRY, 'X')
    and
    (case when :P1_REGION is null then 0
    else cmp.region_seq end)  = nvl(:P1_REGION, 0)
    and
    (case when :P1_CLUSTER is null then 0
    else cmp.cluster_seq end)  = nvl(:P1_CLUSTER, 0)
    and
    (case when :p1_subcluster is null then 0
    else cmp.sub_cluster_seq end)  = nvl(:p1_subcluster, 0)
    and
    (case when :p1_fiscalmonth is null then 'X'
    else srt.fiscal_month end)  = nvl(:p1_fiscalmonth, 'X')
    having count(ptr.emea_category)=1
    group by ptr.row_id,
    ptr.country_code,
    cmp.country_description,
    ptr.name,
    ptr.gsrt_category,
    ptr.gcm_ptr_category,
    ptr.opn_number_esrt,
    ptr.company_id,
    ptr.emea_category,
    ptr.partner_group,
    ptr.global_isv,
    ptr.specialised_partner,
    ptr.opn_membership_level,
    ptr.high_impact_stl,
    ptr.managed_ptr,
    ptr.we_apps_type,
    ptr.isv_ready_status
    order by cd_sum desc)
    where(
    instr(upper("NAME"),upper(nvl(:P1_PNAME,"NAME")))>0
    )Thanks
    Edited by: 917574 on May 30, 2012 1:28 AM

  • Highlight node in tree in apex 4

    Hello!
    The tree has nodes. Node name can include the number in brackets, for example "Messages (1)". Requires such nodes in the tree is highlighted in red, regardless of whether a node is selected or not. At the same time a tree node can be at different levels, not necessarily at the root or leaf.
    I made javascript, but it does not work correctly, API tree is not very clear.
    The script highlights only the first level and all children, and that is not true.
    treeData = window [tree.attr ('id'). replace (/ ^ tree (\ d +)$/, 'l $ 1Data')] [0]. children;
    for (var i = 0; i <treeData.length; i + +)
    try {
    if (/ \ S + \ (\ d + \) $ /. test (treeData . data.title))
    {apex.jQuery ('li [id =' + treeData [i]. attributes.id + '] a'). css ('color', 'red'). css ('font-weight', 'bold'); }} catch (err) {}
    for (var j = 0; j <treeData [i]. children.length; j + +)
    try {if (/ \ S + \ (\ d + \) $ /. test (treeData [i]. children [j]. data.title)
    {apex.jQuery ('li [id =' + treeData [i]. children [j]. attributes.id + '] a'). css ('color', 'red'). css ('font-weight', 'bold');}} catch (err) {}
    Help please!
    [Not correctly work: http://files.mail.ru/FHON5H|http://files.mail.ru/FHON5H]

    It can be used static ID for node
    In sql:
    case when msg_count>0 then 'TreeRed_' || rownum
    else 'TreeBlack_' || rownum
    end as value,
    In js:
    $('[id^="TreeRed_"]').children('a').css('color', 'red').css('font-weight', 'bold');
    How can I highlight node without renaming ID, couse I need ID for links?

  • 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

  • Trees in apex 4.0.2.00.07

    Hello all,
    I can't create tree with custom titles of nodes. for example:
    select case
    when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    <b> case
    when level = 2 then "V001_NODE_NAME"||'[edit]'
    else "V001_NODE_NAME"
    end as title, </b>
    case
    when level = 2 then '#IMAGE_PREFIX#menu/blue_function_16x16.gif'
    when level = 3 then '#IMAGE_PREFIX#menu/hs_infohidden_16x16.gif'
    when level = 4 then '#IMAGE_PREFIX#menu/icon_process_16x16.gif'
    else null
    end as icon,
    "V001_ID_NODE" as value,
    null as tooltip,
    case
    when level = 2 then 'f?p=&APP_ID.:2:&SESSION.::NO::P2_ID_PROJECT:'||v001_original_id
    when level = 3 then 'f?p=&APP_ID.:3:&SESSION.::NO::P3_ID_TARGET:'||v001_original_id
    when level = 4 then null
    else null
    end as link
    from "V001_ANT_TARGETS_TREE"
    start with "V001_ID_PARENT" is null
    connect by prior "V001_ID_NODE" = "V001_ID_PARENT"
    will display nodes as plain text i.e. "...<a href="#">[edit]</a>"
    Any comments and suggestions will be appreciated.

    up

  • Tree in Apex

    Hi,
    Can I change for ever when a page is load the tree in this page "auto expand"?
    Or the item can be highlighted?
    Thanks.

    I have a problem with the tree again.
    I will describe to you:
    I have a tree similar to this
    Home
    Classmates
    --Create
    --Report
    Calendar
    Classes
    --Create
    Teachers
    --Create
    Works
    --Create
    --Report
    The code is:
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "TITLE" as title,
    null as icon,
    "ID" as value,
    "TITLE" as tooltip,
    "LINK" as link
    from "#OWNER#"."TREE"
    start with "PARENT_ID" is null
    connect by prior "ID" = "PARENT_ID"
    order siblings by "TITLE"
    I created a PageZero for the tree and when I select an item I'm redirected to another page, its ok. But I'll that the link reffere the page is selected when I'm in the page corresponding. And I tried with the examples in this forum, but nothing doesn't work. The tree is reload every page is different. Please can somebody help me?
    Thanks and regards.
    Raul Welter

  • How to implement countdown timer in apex

    Hi all,
    I want to implement timer in my application.i am working on apex 4.0 version.I am developing online test application,so for this i want to display timer for test.
    can anyone suggest me how can i implement countdown timer in my application.
    thanks
    jitu

    Hi,
    You can refer "Martin Giffy D'Souza's" Enhanced APEX Session Timeouts example
    http://www.talkapex.com/2009/09/enhanced-apex-session-timeouts.html
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

Maybe you are looking for