Have an ajax memory tree in a pl/sql region be rendered only once in a page

Hi all,
I have a pl/sql region with region source calling a function "ajax_memory_tree.render". Everytime I come back to this particular page, I am having a tree being rendered. Can you give any suggestion as to how I can have only one tree. Thank you for your help/ideas.
regards,
Suma.

procedure render_branch
  (p_type in varchar2, p_icon in varchar2, p_class in varchar2, p_id in number, p_pid in number, p_name in varchar2)
is
x varchar2(1000);
y varchar2(2000);
begin
-- If the branch has sub nodes, render it with a +/- sign
if p_type = 'exp' then
    htp.prn('<li style="vertical-align:right;"><img style="cursor:pointer;margin-right:15px;"
         src="/i/' || p_icon || '.gif" onClick="getTreeNode(this,''' || p_id || ''')" />
   <a class="' || p_class || '" href="f?p=' ||
   v('APP_ID') || ':1:' || v('APP_SESSION') || '::::P1_SELECTED_NODE:' || p_id || '">' || p_name ||
   '</a></span></li>');
-- Otherwise, just render the item
else
if p_id = 5000 then
    select opt_path into x from e_navopts where opt_num = p_id and popt_num = p_pid
    and userid = v('APP_USER');
        htp.prn('<li style="vertical-align:right;margin-left:15px;"><img src="/i/wwv_bullet.gif" style="padding-right:8px;"/><a
  class="' || p_class || '" href="'||x || v('APP_SESSION')|| '::::'||
  '">' || p_name ||'</a></span></li>');
elsif  p_id = 3000 then
    select opt_path into x from e_navopts where opt_num = p_id and popt_num = p_pid
    and userid = v('APP_USER');
    select opt_params into y from e_navopts where opt_num = p_id and popt_num = p_pid
    and userid = v('APP_USER');
       htp.prn('<li style="vertical-align:right;margin-left:15px;"><img src="/i/wwv_bullet.gif" style="padding-right:8px;"/><a
  class="' || p_class || '" href="'||x || v('APP_SESSION')|| '::::'||
  '">' || p_name ||'</a></span></li>');
else
  htp.prn('<li style="vertical-align:right;margin-left:15px;"><img src="/i/wwv_bullet.gif" style="padding-right:8px;"/><a
  class="' || p_class || '" href="f?p=' || v('APP_ID') || ':1:' || v('APP_SESSION') ||
  '::::P1_SELECTED_NODE:' || p_id || '">' || p_name || '</a></span></li>');
    end if;
end if;
end render_branch;

Similar Messages

  • Please can anyone help with ajax memory tree

    I need to have the ajax memory tree expanded on page load. Can anyone please give me some ideas or piece of code. I have the tree working perfectly but only, the users have to click on the + sign to see the branches. This is from Scott Spendolini's example.
    Thanks in advance,
    Suma

    Hi Suma,
    I posted this on the other thread but if you haven't checked that, here is the code I use to simulate the first button click (in a PL/SQL region after the tree region)
    declare
    l_id number;
    begin
    select id into l_id from tree_view where pid is null;
    htp.p('<script language="Javascript">var table = document.getElementsByName("level_1");
    if (table.item(0).name = "level_1")
    getTreeNode(table.item(0),'||l_id||');
    </script>');
    end;
    Cheers,
    Paul

  • Conceptual problem: AJAX Memory tree for navigation

    Hello,
    I have a conceptual problem with a navigation tree.
    I have to implement a AJAX memory tree for navigation purposes, which should be on page 0, so this tree is on the left side of every page.
    Therefore I searches some examples and found this: http://www.oracle.com/technology/pub/articles/spendolini-tree.html
    So I try to rebuild this example with my custom tables and recognised that this example is very slow. I have round about 100 nodes in the tree and my database and network connection is extremly fast(I`m sitting in a proffesional data center).
    So first of all I am wondering why the tree is so slow when I try to expand it and if it is possible to use this tree on the page 0.
    Because of the performance problem I searched for some alternatives, but I didn`t found one.
    Every custom APEX-tree is not dynamic(AJAX) and the dynamic APEX-lists can not base on a select-statement.
    So at this moment I don`t know how to build a AJAX memory tree for navigation which is fast, looks good and works as expected.
    Does anybody have an idea why the tree is so slow?
    Are there alternatives which I can try to use?
    Thank you,
    Tim

    Hi Tim
    100 nodes is not a lot of data for a tree, so why bother with AJAX at all.
    Just render the entire tree, and let the user expand and collapse nodes as they like.
    APEX has a dhtml tree in the standard themes which is enough to get you started.
    The issue I had with it is that it isn't stateful, so doesn't remember which nodes are open between page refreshes.
    That's what got me into ExtJS originally.
    If you look at my demo, I have a couple of examples worth looking at:
    - [tree using APEX lists|http://apex.oracle.com/pls/otn/f?p=200801:2025:0::NO:::] uses APEX built in hierarchical lists, which allows conditional logic on nodes
    - [AJAX editable tree|http://apex.oracle.com/pls/otn/f?p=200801:2013:0::NO:::] which is fully AJAX enabled.
    The other point worth mentioning is if you are using hierarchical queries for your tree you should consider restructuring your data set.
    Typically trees are fairly static, in that the data changes very little over time.
    This makes a very strong case for maintaining the node sequence and level in a denormalised way.
    Data updates become more expensive, but read operations, which will be the bulk of your operations will be very fast.
    Many choices on how to implement, e.g. materialized views with refresh on demand.
    Regards
    Mark
    [Random Insights into Oracle|http://oracleinsights.blogspot.com/] | [Marks Playpen|http://apex.oracle.com/pls/otn/f?p=200801]

  • "+" sign on top of the label in ajax memory tree. Please help..

    Hi all,
    I am following Spendolini's example of creating a ajax memory tree. Everything is working fine, but for the display. The "+" or "-" sign is being displayed on top the label as follows:
    +
    OPTION1
    I placed the tree in sidebar region. Can anyone give me some suggestions?
    Regards,
    Suma.

    Suma,
    That is simply an issue with putting the tree in the sidebar of the template, which has a fixed width. You'll need to change the HTML of the template for that page in order to prevent the "+" from being displayed on its own line. Otherwise, you can put the Tree in a standard region and put your report adjacent to it by selecting Column 2 for the report.
    Thanks,
    - Scott -

  • Ajax memory tree can't expand when searching for a specific node.

    Hi,
    I've just followed the ajax tree example. Everything is working except when the find node windows pop up and a node is selected. the corresponding report is displayed but the ajax tree doesn't expand accordingly.
    Any help would be appreciated.
    Thanks
    Venus

    I too am having this issue with Scott's search ajax tree example listed here..
    http://www.oracle.com/technology/pub/articles/spendolini-tree.html
    The correct node is highlighted if that level of the tree happens to be expanded, but the tree is not automatically expanding to show the correct node. Which part of the code is meant to "automatically expand" the tree? Is it the
    "if tree_rec.id = y.id and tree_rec.id != v('P1_SELECTED_NODE') then..."
    section of "find_node" in
    http://www.oracle.com/technology/pub/listings/spendolini-tree-l1.html
    Any help appreciated.
    Thanks, Penny

  • AJAX Memory Tree

    Hello,
    Has anybody tried the http://www.oracle.com/technology/pub/articles/spendolini-tree.html example? On my Oracle XE for Windows it does not work...when executing the "Listing 1", I receive the "PL/SQL: Error on line 203"...and the line 203 is what follows:
    for x in (select a.pid, a.id, a.name,
    (select count(*) from tree_view b where
    b.pid = a.id) branch_count
    from tree_view a
    where a.pid = v('P1_BRANCH_ID'))
    loop
    if(x.branch_count > 0) then
         -- There are sub-nodes - render with a +/- icon
         insert into tree_temp values(null, v('APP_USER'), v('APP_SESSION'), x.pid, x.id, x.name, 'Y', 'plus');
    else
         -- This is an end-node - no need for a +/- icon
         insert into tree_temp values(null, v('APP_USER'), v('APP_SESSION'), x.pid, x.id, x.name, 'N', null);
    end if;
    end loop;
    end expand;
    Greetings,
    HeCSa.

    I've worked through the example and hit a problem. When I select an item within the tree, it appends another tree below the original tree...although it does update the current node. Has anyone has this problem?
    eg
    Manager
    Emp1
    Emp2
    Emp3
    click on emp2 and get
    Manager
    Emp1
    Emp2
    Emp3
    Manager
    Emp1
    Emp2
    Emp3
    I had a quick look within the process_click procedure within Listing 1 and is reference to an item P1_SELECTED_FD_ID which I presume should be P1_SELECTED_NODE...although changing this didn't solve the problem.
    Thought I would see if it is a general fault before I look further.

  • I have installed the most recent version of Snow Leopard on my MAC, and I am trying to install Mountain Lion from the Apple Store.  It will not install, because it says I do not have 2GB of memory, even though I have over 200GB available.  Please help.

    I have installed the most recent version of Snow Leopard on my MAC, and I am trying to install Mountain Lion from the Apple Store.  It will not install, because it says I do not have 2GB of memory, even though I have over 200GB available.  Please help.

    Welcome to the Apple Support Communities
    One thing is the memory, and another thing is the hard disk space. You are telling me that you have 200 GB of free space on the hard disk, but the App Store is telling you that you have to install 2 GB of memory or more on your Mac if you want to upgrade to OS X Mountain Lion.
    First of all, open  > About this Mac > More Info, and copy "Model Identifier" here, so we can know what Mac you have got and how much memory you can install.
    We recommend to buy the memory in OWC or Crucial (Crucial is cheaper and offers the same compatibility warranty as OWC) because you won't probably have any problem with the memory you buy there

  • How do I add more memory to my Imac, I only have 1GB of memory and need 2GB to download Yosemite!

    How do I add more memory to my Imac, I only have 1GB of memory and need 2GB to download Yosemite?

    Janet,
    This is why the question rkaufmann87 asked about your model is so important:
    [click chart to enlarge if needed]
    The list covers the early iMacs with Intel processors that shipped with either OS 10.4 or 10.5 and have only two RAM slots. As you can see, some have limits to what version of OSX you can install. If the step rkaufmann requests does not narrow down your model, you can do one more thing.
    While the "About this Mac" window is open, click the "More Info..." button at the bottom of that window to get this (assuming you are really running OS 10.5.8 as shown in your profile):
    The code I've indicated with the red arrow corresponds to the codes in the second column on the chart. Post the code your computer reports--again don't post a serial number.
    If your iMac shipped with only 1GB RAM, I fear it is one of the earliest models that cannot be upgraded all the way to Yosemite.

  • Hello there, is there any way i can log onto Game Center via just my Username as i have forgotten the other details (I made the account when i was 11 - I'm now 14 and have a bad memory)

    The Question says it all really.
    Is there any way i can log onto Game Center via just my Username as i have forgotten the other details (I made the account when i was 11 - I'm now 14 and have a bad memory)?
    I remember my Username on Gamcenter but due to the recent update of iOS7, it is only letting me Sign in through my APPLE ID - which i have forgotten over time. I wish to recover my account recently because I remember purchasing Gems on the game 'Clash of Clans' and I wish I could restart playing the game.
    Many thanks for taking your time to read and answer this question.
    -Gavin Chong.

    Hey xChongy!
    I have an article here that can help you find that forgotten Apple ID:
    Apple ID: How to find your Apple ID
    http://support.apple.com/kb/HT5625
    Thanks for using the Apple Support Communities. Have a good one!
    -Braden

  • Do I have a bad memory slot and what to do about it.

    About 3 weeks ago when I came down to my computer, intel imac purchased may 2006, in the morning the screen was black and power button was lit, keyboard did not work and the computer would not wake up from sleep. Rebooted and the power light would come one, no chime or screen power up, and the keyboard would not respond (ie caps lock key would light up). Tried multiple reboots and pulling everything connected out but nothing worked. Next on the torubleshooting list was to remove the ram. With both chips removed, 1gb and 512mb, I would get the flashing powerlight when starting up. I placed back in the 512 chip which is in the slot furthest from the front and the same symptons of just a solid power light with nothing else was exhibited. Removed the chip and placed the 1gb chip back into the slot closest to the front of the computer, everything worked fine. Startup was normal etc. Next, I removed the 1gb chip and put it into the slot towards the back and it would not work, next, moved the 512 chip to the front and all is well. Therefore, I think I have a bad memory slot given the torubleshooting procedures. Is this a correct assumption?
    Here are my questions:
    1. Are there any software solutions that will tell if the memory slot is indeed bad?
    2. Does this sound like a hardware issue or is there an update to the core system that would fix this problem?
    3. In order to get this repaired, would I take the imac to the apple store?
    4. The computer was purchased in May 2006, if I purchased an applecare protection plan, would that cover the repairs or does it need to be purchased within 90 days of the computer?
    Thanks in advance.

    I think that sounds like a firmware update gone bad. Apple page I found says: "In the rare case that your computer displays a black screen after start up, you will need to restore your computers firmware back to factory condition before you can apply firmware update."
    Dont know, but sounds like it.
    http://docs.info.apple.com/article.html?artnum=303364
    may be worth a try.

  • I have reached full memory capacity on my 500GB Time Capsule. I am considering purchasing a 2TB Time Capsule. Do I need to resave all existing data on the new hard drive or can I start afresh? Or can I link both time capsules to operate independantly?

    Hi,
    I  have reached full memory capacity on my 500GB Time Capsule. I am considering purchasing a 2TB Time Capsule.
    a) Do I need to resave all existing data on the new hard drive or can I start afresh?
    b) Or can I link both time capsules to operate independantly?
    Thanks,
    Paul

    You may not need to buy a new Time Capsule. 
    You can connect a USB drive to the Time Capsule, and use it in addition to the TC's internal HD.  You may need a powered USB hub as well.
    Exactly what is on your TC?  If it's only Time Machine backups, you may not need to do anything -- Time Machine will delete the oldest backup(s) automatically when it needs room for new ones.  But if you have more than about 250 GB on your internal HD, that 500 GB may not be large enough to keep backups long enough.
    If you have other data on the TC's internal HD, besides your backups, you could back up to the external HD and use the internal for the other data, or vice-versa.  But TM backups cannot "span" two drives, and you shouldn't mix backups and other data on the TC's internal HD.

  • I use only two channels, have plenty of memory in my hard disk, and external hard drive, no effects, and still having problems with Garage band. Giving messages as you have too many live channels

    I'm frustrated, I am doing everything you recommend, I use only two channels, have plenty of memory in my hard disk, and external hard drive, no effects, and still having problems with Garage band. Giving messages as you ave too many live channels, the disk is slow prepare...can you help?

    Quote from: Richard on 15-November-07, 20:33:05
    tornado2003,
    What you need to do is boot into Safe Mode. Then delete the VGA Drivers.
    After that boot normally and install the latest nVidia ForceWare Drivers
    Take Care,
    Richard
    i guess you missed that:
    Quote from: tornado2003 on 15-November-07, 17:26:52
    ive tryed booting xp in safe mode but it just freezes after it loads up a couple of needed files .
    ive even formatted my hard drive and tryed installing a fresh xp on it but it just keeps locking up when it gets to the "starting windows setup" .(this is just after it loads all the drivers from the xp cd)

  • I have so many photos I only have 1G of memory left.  How can I move the photos to my external hard drive that is connected to my iMac?

    I have so many photos on my Mac I only have 1G of memory left.  How can I move the photos to the external hard drive that is plugged into my iMac.

    1GB? It's a miracle your Mac is running at all!
    This is our resident iPhoto guru, Terence Devlin's, advice:
    You can move your iPhoto Library to an external disk:
    1. Quit iPhoto
    2. Copy the iPhoto Library Folder as an entity from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.

  • Why do I keep getting "an unknown error has occurred" when I try to update or add an app?  I have plenty of memory left.  Suggeestions?

    Why do I keep getting this message "an unknown error has occurred" when I try to update or load an app.  The issue is not space (memory) as I have 2/3 memory left to use.  Any suggestions?

    Hi ...
    Installing the OS X Lion Update 10.7.3 (Client Combo) reinstalls the App Store for you which may help. Restart your Mac after the combo is installed.
    It's ok to do this even though you are already running v10.7.3.
    If that doesn't help, if you have anti virus software installed, disable that.
    If you have an app called LIttle Snitch installed, that can prevent apps from updating.

  • Why does my Macbook Pro tell me that I only have 1GB of memory, when I have 2GB?

    Hello all, I'm a new user so forgive me if I'm asking something already asked.
    I'm looking to download OSX Lion on a 2010 Macbook Pro, 13 inch.  When I tried to download it, an error message came up saying that Lion needs 2GB of memory.  I checked "About this Mac" and it told me I only have 1GB of memory.  I opened up my Macbook, and there are two seperate 1GB sticks inside...call me crazy, but doesn't that mean I have 2GB?  I ordered two more 2GB sticks to upgrade myself to 4GB just for the sake of having more memory, but I'm confused and concerned.

    Try re-seating the sticks.
    Trouble shoot,  swap the location and monitor the results here:
    >About this Mac>More Info>Memory
    Is it a bad bank or a bad stick of RAM
    or no issue after you more firmly seat the RAM

Maybe you are looking for

  • I can't read or download books all so says can't connect to iTunes

    I Can't read any book or download any new ones its also saying can't connect to iTunes please help

  • Torch 9860 sometimes goes silent

    Hi, My wife has a BB torch 9860, and I have updated the os to 7.1.0.523( 7.1 release 1646) from the earlier 7.0 version. Since this update , some times it gets silent, means when we receive a call , the phone does not ring. All the volume and sound a

  • Which ECC table stores shipment # condition type level data?

    Hi all: Here I have a requirement to get freight data at condition type level for each shipment number. Does anybody know which ECC table/field maintain such data? Any post would be appreciated and thank you all in advance! Tim

  • N97 RSS automatic updates

    Hi, I'm using only WiFi to connect my N97 to the internet. I've set both my home and work access points in the Internet connections.  I've set up an RSS feed in the phone's browser, and I want it to automatically update. The problem is that I have to

  • Can data transfer from SAP4.7 version to ECC6.0?

    Hello ABAPers,                        I want to know is it possible to transfer the data from 4.7version to ECC6.0. I want to transfer the Data of a table which is there in ECC6,0 to SAP4.7. I am following the steps given in http://www.**************