Ajaxed Tree

Hi all,
I have created a tree which is working as my navigation aid to tabs, it is using following query
select "PAGE_NO" id,
"PARENT_PAGE_NO" pid,
"NAME" name,
CASE WHEN NAVIGATION = 'Y' THEN 'f?p=&APP_ID.:'||page_no||':&SESSION.::NO::P0_PARENT_TAB:'||PARENT_TAB||'' ELSE null END LINK,
null a1,
null a2
from "#OWNER#"."APEX_PAGES" where page_no not in (select "PAGE_NO" from "#OWNER#"."APEX_USER_PAGES" where "APP_USER"=:APP_USER)
order by IDENTIFIER
But my problem is that page even refreshes when i just click its expand or collapse icon. How can i stop page from refreshing when i click expand or collapse button??? The answer is probably AJAX. But i don't know how can i implement ajax in application express. I have seen few examples, such as BUILDING AJAX MEMORY TREE, but was unable to proceed any furthur. Can anyone explain me step by step, how can i implement ajax in my application on the tree.
Thanks a lot
Sunil Bhatia

Hi,
OK - In my example, page 1 shows the tree but it is defined on page 2.
To set this up, do the following:
1 - Create TWO application items (through Shared Components, Application Items):
G_TREE_ROOT
TEMP_REQUEST
2 - Create an Application Computation (through Shared Components, Application Computations):
Application Item: G_TREE_ROOT
Computation Point: Before Header
Computation Type: Static Assignment
Computation: 7839
These settings are based on using the EMP table for the test pages - 7839 is KING, the top person in the tree, so I just need to set this value. Adjust these as required for your tree.
This computation should be conditional on G_TREE_ROOT being NULL - this ensures that this item gets an initial value
3 - Create a new Page template (through Shared Compenents, Templates) - this should be created "From scratch" rather than as a copy of an existing template. This new template is so that we can output only the contents of a page region rather than an entire page - I call this template "Page Snippet"
When created, edit it. You only need two settings:
Header: (enter a space)
Body: #BOX_BODY#
The space is required as the Header definition is required. #BOX_BODY# will be replaced by the contents of the region on the page
4 - Now create a new page in your app. This should be a "Tree" page - in my example, this is page 2.
The tree's SQL query should be:
select "EMPNO" id,
       "MGR" pid,
       "ENAME" name,
       null link,
       EMPNO a1,
       'f?p=&APP_ID.:1:&SESSION.::::P1_EMPNO:' || EMPNO A2
from "#OWNER#"."EMP"On my page 1, I will have a page item (P1_EMPNO) and a report filtered using this value - A2 is going to be used to create a link to populate P1_EMPNO. The link is not set using the normal LINK item.
The Application Item for the tree needs to be set to G_TREE_ROOT. You should, though, create it as P2_TREE_ROOT to start with and we can change this later
5 - When the tree page has been created set the page to use your new "Page Snippet" page template
6 - You must only have one region on this page - this should, of course, be the region containing the tree. As you don't need anything else on the page, including the buttons, delete everything except for the tree region
7 - On your tree page, add in a new Process:
Name: P2_SET_REQUEST
Process Point: On Load - Before Header
Process:
BEGIN
APEX_APPLICATION.G_REQUEST := :TEMP_REQUEST;
END;8 - Now click on the Tree link in the region to go to the tree's definition.
Change the tree's Application Item setting to: G_TREE_ROOT
Then, you need to adjust a number of the settings in the tree's templates:
Unexpanded Parent:
<td>
<a href="#" onclick="javascript:getTree('EXPAND,#A1#');">
  <img src="#IMAGE_PREFIX#Fndtre02.gif" width="16" height="22" border="0">
</a>
</td>Unexpanded Parent Last:
<td>
<a href="#" onclick="javascript:getTree('EXPAND,#A1#');">
  <img src="#IMAGE_PREFIX#Fndtre03.gif" width="16" height="22" border="0">
</a>
</td>Expanded Parent:
<td>
<a href="#" onclick="javascript:getTree('CONTRACT,#A1#');">
  <img src="#IMAGE_PREFIX#Fndtre05.gif" width="16" height="22" border="0">
</a>
</td>Expanded Parent Last:
<td>
<a href="#" onclick="javascript:getTree('CONTRACT,#A1#');">
  <img src="#IMAGE_PREFIX#Fndtre06.gif" width="16" height="22" border="0">
</a>
</td>Parent Node Template:
<tr>
#INDENT#
<td colspan="#COLSPAN#" valign="CENTER" class="tiny">
  #NAME# #DRILL_UP#
</td>
</tr>Node Text Template:
<tr>
#INDENT#
<td colspan="#COLSPAN#" valign="CENTER" class="tiny">
  #NAME#
</td>
</tr>Name Link Anchor Tag:
<a href="#A2#">#NAME#</a>Name Link Not Anchor Tag:
<a href="#A2#">#NAME#</a>8 - On your page 1 (where the tree will actually be displayed), set the page template to one that includes ".. with Sidebar" - this allows you to use region position 2 to show the tree on the left
9 - Then create a new HTML region and put this in the Page Template Region Position 2 display point. The source of this region should be:
<div id="MyTree"></div>10 - Then add another HTML region on your page. This should use No Template and be in the Before Footer display point. The source of this should be:
<script type="text/javascript">
function getTree(req)
  var get = new htmldb_Get(null,$x('pFlowId').value, null, 2);
  get.add('TEMP_REQUEST', req);
  var gReturn = get.get(null,'<htmldb:BOX_BODY>','</htmldb:BOX_BODY>');
  document.getElementById('MyTree').innerHTML = gReturn;
  document.getElementById('MyTree').innerHTML += "";
  get = null;
  gReturn = null;
getTree('');
</script>11 - Then add a report on the page. The source of this should be:
SELECT EMPNO, ENAME, JOB, SAL, COMM
FROM EMP
WHERE EMPNO = :P1_EMPNO12 - Add a new page item to the report region. This should be a "Display as Text (saves state)" item and called P1_EMPNO
To explain how this works:
Firstly, a Region Pull should only pull contents of a region that does not contain any page items. The region should be the only thing on the page and the page itself must not contain the normal page layout (that is, there should be no tabs etc) - hence the "Page Snippet" page template
When you click on a normal tree's + or - icons for an item, it actually passes a request of either CONTRACT,xxx or EXPAND,xxx (where xxx is the ID for the node being expanded/collapsed).
The getTree() function receives as a parameter a value that we can use for the request. Initially, this is an empty string, so the tree will display in its default state.
Then, as you click on a + or - on our adjusted tree, a call is made to the getTree() function passing in the desired CONTRACT or EXPAND value.
In the Ajax call (the htmldb_Get() function), we do not call an application process (the second null parameter) but tell it that we want the output from page 2 (the final parameter)
The get.add(..) line passes our request value into the TEMP_REQUEST application item. This is done before the get.get(..) call - which does the actual pull.
When page 2 is being rendered on the server, the "On Load - Before Header" takes the value from the TEMP_REQUEST item and sets it as the proper request value for the page. The tree then renders using this (in the same way as it would if the request value was passed via the URL)
The get.get(..) line, retrieves everything on page 2 and updates the DIV tag contents in our page 1 region - which now shows the expanded or collapsed node(s).
As we have updated the tree's definition to call javascript when the + or - are clicked, the actual links are defined in the additional A1 and A2 fields that are available on a tree's SQL. We position #A1# and #A2# on the tree's templates where we want the link to appear - hence having to update so many of the tree's template definitions.
Hopefully, you should be able to adjust the above to fit your application - just remember that my page 1 is the page that is being displayed to the user and page 2 contains the tree. As long as you follow the same steps as above and adjust for your page numbers and SQL, you should be able to achieve your results
Andy

Similar Messages

  • Carl's / Scott's Ajax Tree Example Query

    Hi,
    Hoping someone can assist, I have utilized Carl's and Scott's Ajax tree example, specifically have used the following example from Carl's app, i.e.:
    http://apex.oracle.com/pls/otn/f?p=11933:49:4073287192617448::NO:RP::
    All is working great but my query is, with the following query, that I am using, i.e.
    SELECT "EMP"."MGR" as "MGR",
            "EMP"."EMPNO" as "EMPNO",
            "EMP"."ENAME" as "ENAME" ,
            (select count(*)  from "EMP" "EMP2" where  "EMP2"."MGR" = "EMP"."EMPNO") BranchCount
    from
    "EMP" "EMP"
    where
    "EMP"."MGR"  =  :BRANCH_IDI need to also retrieve the LEVEL pseudo-column as well for each record retrieved as I need the LEVEL info for trying to determine at what level of the tree I am at.
    I believe you can only use the LEVEL column with a CONNECT BY PRIOR clause.
    I would actually like to incorporate the LEVEL column into the above query - is this possible?
    If not, can someone pls assist with re-writing the above query using a connect by clause which will still retrieve the same info as Carl's original query.
    Thanks.
    Tony.

    Hello,
    Sure just replace the body section of the procedure with something like this.
    for c1 in (
    select emp_no,emp_name,emp_manager
    from emps
    order by 2 asc;
         )loop
    htp.prn ('<div>' || c1.emp_no || '-' || c1.emp_name || '-' || c1.emp_manager||'</div>');
    end loop;
    Carl

  • 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

  • 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

  • What i use to develop complex tree and table in my web application?

    hi guys
    simply most of my work in my web application will be depend on:
    1-tree
    2-table
    i need this tree and table deal with database table (or even tables) must be able to do every thing like add node/row/column, delete, update, drag-n-drop, various object nodes/cells like check-box, list, images...etc
    i used JTree and JTable then stoped because i faced problems in dealing with applet/database, and i really didnt see this is perfect way to do that even i agree that JTree and JTable are excellent objects. i also start using ajax tree but i didnt see it robust to have all this complicated work with database.
    by the way i need also master-detail UI table, but its easy to get this if i have good and flexable table object.
    my rest pages developed by jsp, servlet, javascript, html...etc
    so any suggestion to how i build this tree and table? i also heared about JSF, is it serve me?
    thanks

    so if the only way to use JTree and JTable,There are other ways, but they're not Java and might be more complicated.
    are there
    any links you have discussing dealing database with
    applet by keep applet away from direct connection to
    my database?I'm not aware of links, but it's common sense. You don't want to expose the DB server to the internet, and instead contact a server for authentication that then forwards the request to the DB.

  • Can a Tree be used as a Select List?

    Hi
    I'd like to use a tree structure in APEX as an interactive 'Select List Item' or a Menu component.
    When users click on a particular tree node, the selection will be highlighted and it's associated PID from the underlying query can be accessed to filter a Report.
    Is this possible?
    Thanks
    Greg

    Hi Andy
    I had hoped to use the normal APEX tree item to drive interactive user selection.
    The tree report in APEX seems a bit limited for this requirement. I'm unable to click on individual leaf elements.
    The tree list shared component, on the other hand, gives me this functionality. Unfortunately, there does not seem to be a way to populate a list from query?
    I've found Scott Spendolini's AJAX tree, which I'm trying to implement and test to see if it suits my requirements, however, I'd prefer to use internal APEX features, if it all possible.
    Please let me know APEX caters for this.
    Many thanks
    Greg

  • Expand multiple branches in a tree

    i want to know if its possible to expand more than one branch at a time using the URL construct. i understand that the following URL will expand the branch with the id of 7 but I want to expand multiple branches at the same time
    f?p=168:3::EXPAND,7

    Hello,
    You can do EXPAND_ALL that would expand all nodes. I never tried to expand 2 different nodes through the url, but had a look through it and didn't see an immediate request for that.
    A workaround would be to use javascript to doSubmit more than once? Or use another tree (ajax tree or dhtmlx tree for ex)
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • Stop tree refreshing page

    Hello
    I have implemented the AJAX tree, but now want to stop the clicking of a node refreshing my page. I have created an iframe region on the page that I want to refresh when a node is clicked by I dont want the tree to refresh itself. I think my problem is due to the code below (taken from the AJAX tree package), but I'm not sure on how to fix the problem.
    htp.prn('<li style="vertical-align:middle;"><img style="cursor:pointer;margin-right:5px;"src="/i/' || p_icon || '.gif" onClick="getTreeNode(this,''' || p_id || ''') " /><a class="' || p_class || '" href="f?p=' || v('APP_ID') || ':31:' || v('APP_SESSION')|| '::::P1_SELECTED_NODE:' || p_id || '">' || p_name ||'</a></span></li>');
    Please can anyone help?
    Many thanks
    Paul

    Either you submit or you dont submit, there is nothing in between.
    If you submit then you wll need to make all fields get filled in after the submit if you dont want to loose the info.This can be very easily done if you use MVC framewroks like Struts and JSF
    Another option is to submit to a hidden frame or hidden iframe and have some javascript process the data that gets send back on request. This result in your page staying the same but with the possibility to have values changed

  • Possible to use Beehive tags inside Workshop for AJAX?

    All,
    Our application is built using Workshop on WLS SP2, and we were thinking of adding some AJAX features in, especially an AJAX tree control. We know of the BEA WebLogic Tree control, but it doesnt support AJAX. On the other hand, the same control has been re-worked under Apache Beehive to support AJAX. Could anyone please tell me if they have managed to get Beehive tags work inside Workshop? Any pointers/suggestions on other AJAX-enabled Tree controls are welcome too!
    Thanks ,
    Vikram.

    At this point, Beehive tags can't be used in Workshop 8.1 apps. Beehive depends on JDK 1.5 features that are not available in Workshop 8.1.
    Thanks,
    David Gorton
    Workshop Customer Centric Engineering (CCE)

  • Group Tree: Error in Ajax response - message: missing } in XML expression

    Hi,
    We were using a previous version of Crystal libs and viewer. I wanted to get up to date with the latest jars and viewer so I downloaded and installed the version with Eclipse 3.4.1 and crystal development bundled together.
    I've copied the new jars from there into my existing project. I've also copied the folder cyrstalreportviewers into the project. We're using Tomcat 6.
    I've now got a problem with the Group Tree at the moment since I started using the latest libraries and crystal report viewers.
    My web.xml looks like this.
            <context-param>
              <param-name>crystal_image_uri</param-name>
              <param-value>/crystalreportviewers</param-value>
         </context-param>
         <context-param>
              <param-name>crystal_image_use_relative</param-name>
              <param-value>webapp</param-value>
         </context-param>
            <servlet id="CrystalReportViewerServlet">
              <servlet-name>CrystalReportViewerServlet</servlet-name>
              <display-name>CrystalReportViewerServlet</display-name>
              <servlet-class>
                   web.servlet.ReportingViewerServlet
              </servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
           <servlet-mapping id="CrystalReportViewerServletMapping">
              <servlet-name>CrystalReportViewerServlet</servlet-name>
              <url-pattern>/CrystalReportViewerHandler</url-pattern>
         </servlet-mapping>
    A request to the uri https://......../WebApp/CrystalReportViewerHandler?id=3
    The servlet doesn't do anything that seems to be uncommon. I can post more precisely what it does if needed.
    The report will load correctly, I don't get an error page asking if my crystalreportviewers/ path is accessable to the server.
    I get a parameter page asking for a value. I enter that and click OK.
    The viewer sends a POST request to my Servlet and is handled correctly.
    The report is then loaded.
    On the click of an item in the Group Tree it sends an Ajax POST request and I then get the following error:
    message: missing } in XML expression
    fileName: https://localhost:8080/WebApp/crystalreportviewers/allInOne.js
    lineNumber: 10
    stack: ()@:0
    eval("(\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n)")@:0
    ([object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object Object],[object Object],[object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:12
    ([object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ()@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object XMLHttpRequest])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object Object],[object Event])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    ([object Event])@https://localhost:8080/WebApp/crystalreportviewers/allInOne.js:10
    name: SyntaxError
    Clicking on the Groups headers on the right hand pane work as expected. Although I notice they are not Ajax requests.
    I've spent a few days at this now and I feel like I'm running out of options but to revert back to the previous version we were using. I presume this works elsewhere so I've got to be doing something incorrectly with my setup.
    If anyone needs more info then please ask.
    Thanks,
    Patrick

    Hi Ted,
    Thanks for your reply.
    That's our own Servlet. It extends javax.servlet.http.HttpServlet
    doGet does the following stuff:
    Creates a ReportClientDocument.
    Sets the ReportAppServer to "inproc:jrc".
    Opens the report as read only.
    Gets the DBController and calls logon on it.
    Then calls replaceConnection.
    Adds some discrete param values.
    Creates a CrystalReportViewer.
    gets the report source from the report client document.
    sets the report source on the crystal report viewer.
    set own page to true.
    sets the report source in the session.
    The crystal Report Viewer then processes the Http Request.
    doPost:
    gets the report source from the session.
    creates a CrystalReportViewer.
    sets the report source on the crystal report viewer.
    set own page to true.
    The crystal Report Viewer then processes the Http Request.
    One thing I changed in there was the way the data source was changed. It used to loop through tables.
    Tables tables = clientDoc.getDatabaseController().getDatabase().getTables();
    newTable.setQualifiedName(qualifiedName);
    clientDoc.getDatabaseController().setTableLocation(origTable, newTable);
    Now it does this:
    DatabaseController dbController = clientDoc.getDatabaseController();
    dbController.logon(username, password);
    dbController.replaceConnection(new ConnectionInfo(), connectionInfo, null, DBOptions._useDefault);
    If you need more info please do let me know. Thanks for your help.
    Patrick

  • Is it possible to create a tree with drag-and-drop functionality using ajax

    I saw these samples;
    Scott Spendolini's AJAX Select List Demo
    http://htmldb.oracle.com/pls/otn/f?p=33867:1:10730556242433798443
    Building an Ajax Memory Tree by Scott Spendolini
    http://www.oracle.com/technology/pub/articles/spendolini-tree.html
    Carl Backstrom ApEx-AJAX & DHTML examples;
    http://htmldb.oracle.com/pls/otn/f?p=11933:5:8901671725714285254
    Do you think is it possible to create a tree with drag-and-drop functionality using ajax and apex like this sample; http://www.scbr.com/docs/products/dhtmlxTree/
    Thank you,
    Kind regards.
    Tonguç

    Hello,
    Sure you can build it, I just don't think anyone has, you could also use their solution as well in an APEX page it's just a matter of integration.
    Carl

  • 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 -

  • 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('&lt;li style="vertical-align:right;">&lt;img style="cursor:pointer;margin-right:15px;"
             src="/i/' || p_icon || '.gif" onClick="getTreeNode(this,''' || p_id || ''')" />
       &lt;a class="' || p_class || '" href="f?p=' ||
       v('APP_ID') || ':1:' || v('APP_SESSION') || '::::P1_SELECTED_NODE:' || p_id || '">' || p_name ||
       '&lt;/a>&lt;/span>&lt;/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('&lt;li style="vertical-align:right;margin-left:15px;">&lt;img src="/i/wwv_bullet.gif" style="padding-right:8px;"/>&lt;a
      class="' || p_class || '" href="'||x || v('APP_SESSION')|| '::::'||
      '">' || p_name ||'&lt;/a>&lt;/span>&lt;/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('&lt;li style="vertical-align:right;margin-left:15px;">&lt;img src="/i/wwv_bullet.gif" style="padding-right:8px;"/>&lt;a
      class="' || p_class || '" href="'||x || v('APP_SESSION')|| '::::'||
      '">' || p_name ||'&lt;/a>&lt;/span>&lt;/li>');
    else
      htp.prn('&lt;li style="vertical-align:right;margin-left:15px;">&lt;img src="/i/wwv_bullet.gif" style="padding-right:8px;"/>&lt;a
      class="' || p_class || '" href="f?p=' || v('APP_ID') || ':1:' || v('APP_SESSION') ||
      '::::P1_SELECTED_NODE:' || p_id || '">' || p_name || '&lt;/a>&lt;/span>&lt;/li>');
        end if;
    end if;
    end render_branch;

Maybe you are looking for

  • VB Macro (BW 3.5)

    Hi ppl, I am new to VB. I have a requirement where I have info object YVENDOR which is compounded with 0LOGSYS. In the query output (workbooks) I want to truncate the 0logsys part. eg: the output is DVCLNT900/59000001, but I want to show only  590000

  • Pressing keys makes multiple characters after being taken apart

    gonna make this short and sweet since im using on screen keyboard spilled water on laptop took apart laptop all the way down to motherboard  let everything dry off and put it back together computer works but when i press certain keys other characters

  • Movie loads separately but not as part of whole...

    I am trying to load jpeg images using loadMovie. I have a movie that has thumbnail images that load larger jpeg images when the user clicks on a thumbail. This movie is loaded from an action in the root timeline. When launch the swf file for that mov

  • Refresh a view without losing changes?

    Hi, Is there a way to refresh a view to get the new rows added (and commited) using another transaction but without losing the rows added in the current transaction? (update keeping the dirty stuff) Thank you!

  • Which way for 7x5 paper in D7160?

    I'm trying to print a landscape format photo onto 7x5 paper in my Photosmart D7160 using Photoshop Elements 6. I've tried putting the paper in the Main tray in both landscape and portrait positions, aliginging it to the right-hand side (as you look a