Dynamic menu in tree structure in JSP

Hi,
1) I need to display a dynamic menu in JSP. The menu depends on the values received from database. I need to show the items in the structure of tree (like parents, child relation). The tree can have multiple levels (the parent can have children & these children too can have children). This tree structure would be on left side of the screen.
I would like to use some custom tags rather than javascript. Can somebody post the custom tags or some samples?
2) Also, once the user selects different items from menu, different action classes should be called. And accordingly, the right side of the screen will show different data.
So, there should be any way to set different action classes for the menu items. Please post any samples or helpful links.

Hi,
1) I need to display a dynamic menu in JSP. The menu depends on the values received from database. I need to show the items in the structure of tree (like parents, child relation). The tree can have multiple levels (the parent can have children & these children too can have children). This tree structure would be on left side of the screen.
I would like to use some custom tags rather than javascript. Can somebody post the custom tags or some samples?
2) Also, once the user selects different items from menu, different action classes should be called. And accordingly, the right side of the screen will show different data.
So, there should be any way to set different action classes for the menu items. Please post any samples or helpful links.

Similar Messages

  • Tree Structure in JSP

    Hi,
    I have an xml file , my requirement needs me to display the xml file as a tree structure in jsp. The user should be able to make changes to tree. he can drag and drop the nodes and save the changes.
    I parsed the xml file and created a method that returns an arrayList of the immediate children given a node.I'am not getting how to proceed from there on.
    Can anyone provide me with any useful tips or code. I can use javascript css java(not swing).Please reply ASAP as I have to complete it soon.
    Thanks,
    Sabi

    Hi why dont you try the link below,
    basically its for menu u can change it,
    http://demo.raibledesigns.com/struts-menu/
    in the above link see the following hyperlink
    Expandable DHTML List Example - Shows Expandable DHTML list

  • Creating a tree structure in jsp- URGENT

    Hi,
    I need to create a tree structure using jsp. Can anybody help me out.
    Thanks in advance.

    to do what? to store what? be more specific dude. As a first suggestion use XML.

  • How to Implement Dynamic Tree structure in jsp

    Hi,
    Does any body help me to solve out my requirement??
    I want to display all my folder contents (parent & childs) in windows explorer format, the root folder path will come from database.
    Thanks in advance

    There are many ways to achieve this. The simplest would be to use some existing tag library that renders a tree structure and feed it with the required data.

  • How to get Tree structure in JSP page?

    Hi,
    I would like get data from the database and display the data in tree structure with the check boxes at each nodes on a jsp page with out using any third party tools. how can i do that? Do i require any new tags to fulfill this requirement?
    can any one help me out by sending any example code?
    thanks in advance.
    Regards,
    Reddy

    Once you have the data in a list or something, can't you just use <c:forEach> and then output standard nested <ul> and <li> tags to give the tree structure.
    <html>
         <style>
              li
                   list-style-type:none;
         </style>
         <body>
              <form>
                   <ul>
                        <li>
                             <input type="checkbox">Check 1</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 1A</input>
                                  </li>
                                  <li>
                                       <input type="checkbox">Check 1B</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 2</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 2A</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 3</input>
                        </li>
                   </ul>
              </form>
         </body>
    </html>

  • Embedding a table in a tree structure in an in WebDynpro application

    Hi All,
    I need an application that displays a table dynamically in a tree structure as it's child node.
    Can any one suggest me how to approach ?

    Hi SMI SAP Project Team,
    Please check the code for loop and lead selection when you setting the values.
    for( f = 0; f < e; f++)
    Refer to below documents:
    initializing AbstractList Model in Custom Controller
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/761eba66-0401-0010-b982-d5f5bd9e8f90?quicklink=index&overridelayout=true
    Hope it will helps
    Regards
    Arun

  • Dynamic Tree Creation using JSP, Struts framework

    I urgently require tips/information/code snippet for creating a Dynamic Tree structure.
    Tree is the hierarchical folder structure that we see in windows operating system.
    Dynamic tree in the sense that all nodes shall be populated from database & a radio button shall be present at each node that can be selected & submitted to form.
    Tree should be done using JSP (& if required Javascript).
    I am using Struts framework .
    [email protected]

    u need to know quite a few java technologies to make archieve your dream.
    JDBC, dynamic array and JSP.
    after reading tutorial regarding to these 3 materials, you should be able to get your job done.

  • Make a dynamic menu using JSP or Javascript

    Hi ,
    I am trying to make a dynamic menu that is using data retrieved from database in the form of a list.
    I have a javascript to make a tree structure menu, but i need to iterate through the list i am reciveing from the database to make the tree structure. here is the code :-
    <Please reply ASAP as my deadline is near>
    <Note:- in javascript to make static menu ul tag is used to make the parent node and li tag is use to make the child node>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript" SRC="mktree.js"></SCRIPT>
    <LINK REL="stylesheet" HREF="mktree.css">
    </head>
    <body>
    <%@ page import = "java.util.ArrayList, java.util.Iterator, java.util.List, \WEB-INF\classes\DO_JSP.class,
    \WEB-INF\classes\Url_Name.class, java.util.Comparator, java.util.TreeSet, \WEB-INF\classes\MyComp.class" %>
    <%
         class Url_Name {
         String linkName;
         String linkUrl;
         int order;
         * @return the order
         public int getOrder() {
              return order;
         * @param order the order to set
         public void setOrder(int order) {
              this.order = order;
         * @return the linkName
         public String getLinkName() {
              return linkName;
         * @param linkName the linkName to set
         public void setLinkName(String linkName) {
              this.linkName = linkName;
         * @return the linkUrl
         public String getLinkUrl() {
              return linkUrl;
         * @param linkUrl the linkUrl to set
         public void setLinkUrl(String linkUrl) {
              this.linkUrl = linkUrl;
    class MyComp implements Comparator{
         public int compare(Object a, Object b){
              return (((Url_Name)a).getOrder() - ((Url_Name)b).getOrder());
         class DO_JSP
         int parentId;
         String parentName;
         TreeSet linkList;
         Url_Name tempurl;
         * @return the linkList
         DO_JSP(){
              linkList = new TreeSet(new MyComp());
         public TreeSet getLinkList() {
              return linkList;
         * @param linkList the linkList to set
         public void setLinkList(String linkName, String linkUrl, int order) {
              tempurl = new Url_Name();
              tempurl.setLinkName(linkName);
              tempurl.setLinkUrl(linkUrl);
              tempurl.setOrder(order);
              this.linkList.add(tempurl);
         * @return the parentName
         public String getParentName() {
              return parentName;
         * @param parentName the parentName to set
         public void setParentName(String parentName) {
              this.parentName = parentName;
         * @return the parentId
         public int getParentId() {
              return parentId;
         * @param parentId the parentId to set
         public void setParentId(int parentId) {
              this.parentId = parentId;
    %>
    <%
              List listdojsp =new ArrayList();
              listdojsp = (List)session.getAttribute("JspListName");
              Iterator it = listdojsp.iterator();
              do
    %>
              <%
              DO_JSP tempdojsp = (DO_JSP)it.next();
              String Parent = tempdojsp.getParentName();
              %>
              <ul class="mktree">     
              <li> Parent </li>
                   <ul>
              <%
              Iterator ittemp = tempdojsp.getLinkList().iterator();
                   do
                        Url_Name tempurlname = new Url_Name();
                        tempurlname = (Url_Name)ittemp.next();
                        String link = tempurlname.getLinkName();
              %>
                        <li>link</li>
              <%
                   }while(ittemp.hasNext());
              %>
                   </ul>
                   </ul>          
              <%     
              }while(it.hasNext());
              %>
    </body>
    </html>

    Hi ,
    I am trying to make a dynamic menu that is using data
    retrieved from database in the form of a list.
    I have a javascript to make a tree structure menu,
    but i need to iterate through the list i am reciveing
    from the database to make the tree structure. here is
    the code :- Hi, do you have a question? This is more of a "Look what I wrote" sort of post, and you don't seem to be asking for any specific advice. Please tell us what problem you're having, or the error message you're receiving.
    Brian

  • Dynamic menu creation in JSP treating source as dynamic xml

    Hi Everyone,
    I have a XML file which is a dynamic one..It is generated from a tool..I need to parse that xml and generate a menu accordingly in a jsp.In menu the data to be displayed comes from thie hierarchical xml file which is a dynamic one..Siblings and child notes are not fixed..it all generates at rum by some other tool.
    Please help me to tell any logic to create such a dynamic menu ...i am using Dom parser to parse that..
    Regards
    Sajal

    Hi
    This is the xml...I want to display the values in a JSP menu..These values comes from this XML...Like for this XML the struscture will be like
    --Category
    |
    | IT Services
    |
    |ABC Softwares
    |
    |Application Developement
    |
    |Java
    |Mainframes
    |Production Support
    <DIMENSIONS>
    <DIMENSION NAME="CATEGORY">
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="1"/>
    <VALUE>IT Services</VALUE>
    </DVAL>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="2"/>
    <VALUE>ABC Softwares</VALUE>
    </DVAL>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="3"/>
    <VALUE>Application Development</VALUE>
    </DVAL>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="4"/>
    <VALUE>Java</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="5"/>
    <VALUE>Mainframes</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    </DIMENSION_NODE>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="6"/>
    <VALUE>Production SUpport</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    </DIMENSION_NODE>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="7"/>
    <VALUE>DEF Softwares</VALUE>
    </DVAL>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="8"/>
    <VALUE>Application Development</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="9"/>
    <VALUE>Production SUpport</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    </DIMENSION_NODE>
    </DIMENSION_NODE>
    </DIMENSION>
    </DIMENSIONS>
    So in this way i need to populate the data from XML.. there can be n number of nodes child nodes and Siblings..and siblings can also have further Child nodes...So need to populate the JSP Menu from this xml..
    Please suggest some logic or if somebody has some sample code..

  • How to create a table less structure with dynamic menu module

    Hi guys,
    I am using dynamic menu module for creating a main menu for http://firstsite08.businesscatalyst.com/
    but it is generating table structure. What changes to do i had to make to generate a table less structure from dynamic menu module.

    Hi Andy,
    When you create a Menu, the option dropdown for the menu has Default, but under that you will see HTML CSS Only option which creates a ul li structure.
    For the Menu Module options you can find more information from the knowledgebase: http://kb.worldsecuresystems.com/134/bc_1345.html?bc-partner#main_Menu_Modules
    If you would like to use the version 2 menu module you can find a bit of a guide I wrote here: http://forums.adobe.com/docs/DOC-1903

  • How we can generate dynamic menu in jsp page

    Hi all,
    how we can generate dynamic menu in jsp page.
    Thanks
    Manjinder

    by reading more about them on the web or in a good book, OR BY HIRING SOMEBODY TO DO SO. ;)

  • Dynamic Menu in JSP

    Hi,
    I have to make a menu just like www.staple.com in my JSP. The main product category and sub-category are read from the database. I have classes written which retrieve the product and sub categories but dont know hot to proceed with building of dynamic menu in my JSP. Please let me know how to move forward for this one.
    Thanks

    Hi,
    I tried to do something like this :
    *******CODE*******
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <%@taglib uri="/struts-tags" prefix="s"%>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
         <style type="text/css">
         body {
              font-family: arial, helvetica, serif;
         #nav, #nav ul { /* all lists */
              padding: 0;
              margin: 0;
              list-style: none;
              float : left;
              width : 11em;
         #nav li { /* all list items */
              position : relative;
              float : left;
              line-height : 1.25em;
              margin-bottom : -1px;
              width: 11em;
         #nav li ul { /* second-level lists */
              position : absolute;
              left: -999em;
              margin-left : 11.05em;
              margin-top : -1.35em;
         #nav li ul ul { /* third-and-above-level lists */
              left: -999em;
         #nav li a {
              width: 11em;
              w\idth : 10em;
              display : block;
              color : black;
              font-weight : bold;
              text-decoration : none;
              background-color : white;
              border : 1px solid black;
              padding : 0 0.5em;
         #nav li a:hover {
              color : white;
              background-color : black;
         #nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul {
              left: -999em;
         #nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul { /* lists nested under hovered list items */
              left: auto;
         #content {
              margin-left : 12em;
    </style>
    <script type="text/javascript">
    sfHover = function() {
         var sfEls = document.getElementById("nav").getElementsByTagName("LI");
         for (var i=0; i<sfEls.length; i++) {
              sfEls.onmouseover=function() {
                   this.className+=" sfhover";
              sfEls[i].onmouseout=function() {
                   this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
    if (window.attachEvent) window.attachEvent("onload", sfHover);
    //--><!]]></script>
    </head>
    <body>
    <ul id="nav">
         <s:iterator value="productList" id="products">     
                   <li> <s:url id="getProductCategoryCodesURL" action="listProductCategoryCodesByProductCd">
                                                      <s:param name="productCd" value="%{productCd}"></s:param>
                                                 </s:url>                                              
                                                 <s:a href="%{getProductCategoryCodesURL}" ><s:property value="productNm" /></s:a>
                                                 <input type="hidden" id="prodCd" value="<s:property value="productCd" />"/>
                             </li>
    </s:iterator>
    </ul>
    </body>
    </html>
    ****END CODE******
    So i was able to get the product categories in the menu but on mouse hover for a particular product category it should show sub-categories also. I can't think of a way to do that , can anyone please suggest ?

  • Storing a dynamic menu structure

    Hello all,
    I am creating (or at least hoping to create) a completely dynamic web site using oracle9i as the backend. Right now I am stumped on how to store a dynamic menu hierarchy. I want to be able to assign different menu options to different user types, and also be able to add more levels to the menu later on.
    Example:
    Outer Most Menu (Level 0) Item 1
    Level 1 Sub-Menu Item 1
    Level 1 Sub-Menu Item 2
    Level 2 Sub-Menu Item 1
    Level 1 Sub-Menu Item 3
    Level 2 Sub-Menu Item 1
    Level 2 Sub-Menu Item 2
    Level 2 Sub-Menu Item 3
    Level 1 Sub-Menu Item 4
    Outer Most Menu (Level 0) Item 2
    Level 1 Sub-Menu Item 1
    Level 2 Sub-Menu Item 1
    Level 1 Sub-Menu Item 2
    Level 1 Sub-Menu Item 3
    Level 1 Sub-Menu Item 4
    Level 2 Sub-Menu Item 1
    Level 2 Sub-Menu Item 2
    Level 2 Sub-Menu Item 3
    I would like to be able to store the above structure in the database so that I could add more menu items and levels. I am trying to design the structure so that an XML document can be created from a query whose hierarchical structure will resemble the menus. I can create everything, except adding more levels, I want by defining each level as a type.
    Any thoughts?
    Thanks,
    Thomas Usrey

    If you want to display list for ADMIN's you can set it like this:
    rendered="#{jhsUserRoles['ADMIN']}"

  • Tree structure menu?

    Hello,
    Does anyone know a component to select menu like a tree structure? I see Accordian Menu can go only two levels. We have requirement to go more levels? Any help/guidance is appreciated.
    Thanks
    Manohar

    HI Manohar,
    maybe you can try the Xcelsius Add-On "XComponents". There you have additional objects available including one object called "tree". With this object you can define a hierarchical navigation structure, also with more than two levels. However i don't know if this add-on is for free or not as i only saw some examples here.
    Best
    Stefan

  • A recursive, dynamic menu tree in ColdFusion

    Hi
    i want to made a recursive, dynamic menu tree in ColdFusion.
    i search on net menu example, following example
    EXEMPLE
    But there are no file for download. Any one have these files
    for simples.
    Regards !

    Did you try googling the author's name? If you had, you have
    found this:
    http://www.sitepoint.com/article/dynamic-menu-coldfusion
    Bryan Ashcraft (remove brain to reply)
    Web Application Developer
    Wright Medical Technology, Inc.
    Macromedia Certified Dreamweaver Developer
    Adobe Community Expert (DW) ::
    http://www.adobe.com/communities/experts/
    "<< CFMX >>" <[email protected]>
    wrote in message
    news:f411qf$636$[email protected]..
    > Hi
    >
    > i want to made a recursive, dynamic menu tree in
    ColdFusion.
    >
    > i search on net menu example, following example
    >
    http://builder.com.com/5100-6371-5196767.html
    >
    > But there are no file for download. Any one have these
    files for simples.
    >
    > Regards !
    >
    >
    >

Maybe you are looking for

  • Why does my live site have formatting errors?

    I have uploaded my site, made changes, re-uploaded, and then did that several times.  Now, all of a sudden, the appearance of my fonts when I publish the amended site looks different than it does on iWeb - and not in a good way.  How can I fix these

  • Import - stopped - file to big

    Hi, I scanned the forums and FAQs and didn't find any hint so I want to raise a question. - I made a nice panorama photo with photoshop and want to add this psd file to lightroom. So I synchronized the folder and LR indicates that there is a new phot

  • Error installing Application server on Red Hat 8

    I am trying to install Application Server but I cant because I get an error message saying the following: "Error in invoking target install of makefile /opt/oracle/product/ora9ias/sqlplus/lib/ins_sqlplus.mk" Can anyone explain to me what does this me

  • How do I resolve error (-1202)?

    I have fought with this error for over 6 months. "We could not complete your iTunes Store request. An unknown error occurred (-1202). I have reviewed all the usual suspects, Firewall, does not work on other networks, other devices connect on ISP, Dat

  • My Music to web Galley? can i export my songs to  my web gallery?

    can i export my songs to my web gallery? just music file. i am not talking about photo slide show back ground music or movie. just music file. and my friend can download etc..