This discussion is archived
1 Reply Latest reply: Feb 7, 2013 6:41 AM by 989475 RSS

2 Trees on the same Page

989475 Newbie
Currently Being Moderated
Hi!
I'm using Apex Version: 4.2.1.00.08

I created a page with 2 tree regions. Both trees use different items and different queries. The first tree is displayed correctly. But the second one just contains the first item, if I don't display the first on via customizing the page or if I change the order of the trees the previoulsy invalid tree is shown correctly, but I didn't find a way to disply both correct at the same time.
  • 1. Re: 2 Trees on the same Page
    989475 Newbie
    Currently Being Moderated
    Finally I found out what's the problem.
    I had 2 tables e.g.:

    AG_ID;Name;Parent_ID
    0;Top Entry AG;NULL
    1;Level 1 Entry AG;0

    TG_ID;Name;Parent_ID
    0;Top Entry TG;NULL
    1;Level 1 Entry TG;0

    caused by the fact that both tables use same IDs to identify the entrys the javascript seems to get errors.

    I used concats and substr function to create unique IDs for the tree elements, so the JavaScript gets TG0 or AG0 as value not just 0. Now everything works fine.

    Here is an example for my modified tree query:

    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "NAME" as title,
    null as icon,
    CONCAT('AG', "AG_ID") as value,
    null as tooltip,
    'f?p=&APP_ID.:1:'||:APP_SESSION||'::::V_AGID,V_TGID:'||'AG'||"AG_ID",NULL as link
    from "#OWNER#"."GROUPS_APPLICATION" GROUPS_APPLICATION
    start with "GROUPS_APPLICATION"."PARENT_ID" IS NULL
    connect by prior "GROUPS_APPLICATION"."AG_ID" = "GROUPS_APPLICATION"."PARENT_ID"
    order siblings by "NAME"

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points