Displaying Nested Sets

Hello~
I am just starting to use the nested set model for storing hierarchical data in a database, and while I understand the concept, I am not at all sure how to actually display the data in, say, an unordered list! Right now, I am using the following query to retrieve my list:
SELECT
        node.pageName
    FROM
        admin_nav AS node,
        admin_nav AS parent
    WHERE
        node.lft BETWEEN parent.lft AND parent.rght
        AND parent.pageName = 'Assessment'
    ORDER BY
        node.lft
It outputs correctly if I cfdump it, but I am not sure how to create a loop that would put the <ul> and <li> tags in the correct places. I have searched for some kind of tutorial about this, but no luck! Any help would be appreciated. Thanks!
KC

OK, I think I have got it all figured out, and I thought I would post my solution! Thanks to everyone for your help!
I added a new table to my database to hold any special formatting tags for a given depth of the list (ie, I want my 1st level items to be enclosed in <h2></h2> tags).
Query:
    SELECT
        o.pageName,
        o.depth,
        ant.specialTag
    FROM
        ADMIN_nav_tag AS ant
        RIGHT JOIN
                SELECT TOP (100) PERCENT
                    node.pageName,
                    (COUNT(parent.pageName) - 1) AS depth
                FROM
                    admin_nav AS node,
                    admin_nav AS parent
                WHERE
                    node.lft BETWEEN parent.lft AND parent.rght
                    AND node.pageName <> 'Home'
                GROUP BY
                    node.pageName,
                    node.lft
                ORDER BY
                    node.lft
        AS o
        ON ant.depth = o.depth
Output:
<div id="navBar">
    <ul>
        <Cfset count = 0 />
        <cfoutput query="getNav" group="depth">
            <cfset liTag = '' />
            <cfif specialTag NEQ ''>
                <cfset liTag = '<' & #specialTag# & '>' />
            </cfif>
            <cfoutput>
                <Cfset fdepth = getNav.depth[getNav.currentRow + 1 ] />
                <cfif lengthcount eq 1>
                    <li>#liTag##pagename##replaceNoCase(liTag, '<', '</')#</li>
                <cfelse>
                    <li>#liTag##pagename##replaceNoCase(liTag, '<', '</')#
                    <cfif count lt lengthCount -1>
                        <Cfif fdepth gt depth>
                            <ul>
                        <cfelse>
                            </li>
                        </Cfif>
                        <cfif fdepth lt depth>
                            #repeatString('</ul></li>',depth-fdepth)#
                        </cfif>
                    <cfelse>
                        </li>
                    </cfif>
                    <Cfset count = count + 1 />
                </cfif>
            </cfoutput>
        </cfoutput>
    </ul>
</div>

Similar Messages

  • Display Nested table data in an ALV format

    Hi All,
    Is there any way to display nested table data in an ALV format. This table has 20-30 structures in it and there is no way to create a common structure using all the fields. Kindly let me know what is the best way to display the nested structure data.
    Thanks a lot for your responce.
    Regards,
    Priti

    REPORT  yh_alvtreedemo1.
    TYPE-POOLS : fibs,stree.
    TYPE-POOLS:slis.
    DATA : t_node TYPE snodetext.
    DATA : it_node LIKE TABLE OF t_node,
           wa_node LIKE t_node.
    DATA: t_fieldcat    TYPE slis_t_fieldcat_alv,
          fs_fieldcat   TYPE slis_fieldcat_alv.
    DATA:w_repid LIKE sy-repid.
    *Internal Table declarations
    DATA: BEGIN OF fs_scarr,
            carrid LIKE scarr-carrid,
          END OF fs_scarr.
    DATA:BEGIN OF fs_spfli,
            carrid LIKE spfli-carrid,
            connid LIKE spfli-connid,
         END OF fs_spfli.
    DATA:BEGIN OF fs_sflight,
            carrid LIKE sflight-carrid,
            connid LIKE sflight-connid,
            fldate LIKE sflight-fldate,
         END OF fs_sflight.
    DATA:BEGIN OF fs_sbook,
            carrid LIKE sbook-carrid,
            connid LIKE sbook-connid,
            fldate LIKE sbook-fldate,
            bookid LIKE sbook-bookid,
         END OF fs_sbook.
    DATA:t_scarr LIKE TABLE OF fs_scarr,
         t_spfli LIKE TABLE OF fs_spfli,
         t_sflight LIKE TABLE OF fs_sflight,
         t_sbook LIKE TABLE OF fs_sbook.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM build_tree.
      PERFORM display_tree.
    *&      Form  get_data
    FORM get_data .
      SELECT carrid
             FROM scarr
             INTO TABLE t_scarr.
      SELECT carrid
              connid
              FROM spfli
              INTO TABLE t_spfli
              FOR ALL ENTRIES IN t_scarr
              WHERE carrid EQ t_scarr-carrid.
    ENDFORM.                    " get_data
    *&      Form  build_tree
    FORM build_tree .
      CLEAR: it_node,
             wa_node.
      SORT: t_scarr BY carrid,
            t_spfli BY carrid connid,
            t_sflight BY carrid connid fldate,
            t_sbook BY carrid connid fldate bookid.
      wa_node-type = 'T'.
      wa_node-name = 'Flight Details'.
      wa_node-tlevel = '01'.
      wa_node-nlength = '15'.
      wa_node-color = '4'.
      wa_node-text = 'Flight'.
      wa_node-tlength ='20'.
      wa_node-tcolor = 3.
      APPEND wa_node TO it_node.
      CLEAR wa_node.
      LOOP AT t_scarr INTO fs_scarr.
        wa_node-type = 'P'.
        wa_node-name = 'CARRID'.
        wa_node-tlevel = '02'.
        wa_node-nlength = '8'.
        wa_node-color = '1'.
        wa_node-text = fs_scarr-carrid.
        wa_node-tlength ='20'.
        wa_node-tcolor = 4.
        APPEND wa_node TO it_node.
        CLEAR wa_node.
        LOOP AT t_spfli INTO fs_spfli WHERE carrid EQ fs_scarr-carrid.
          wa_node-type = 'P'.
          wa_node-name = 'CONNID'.
          wa_node-tlevel = '03'.
          wa_node-nlength = '8'.
          wa_node-color = '1'.
          wa_node-text = fs_spfli-connid.
          wa_node-tlength ='20'.
          wa_node-tcolor = 4.
          APPEND wa_node TO it_node.
          CLEAR wa_node.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " build_tree
    *&      Form  display_tree
    FORM display_tree .
      CALL FUNCTION 'RS_TREE_CONSTRUCT'
        TABLES
          nodetab = it_node.
      w_repid = sy-repid.
      CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
        EXPORTING
          callback_program      = w_repid
          callback_user_command = 'USER_COMMAND'
          callback_gui_status   = 'SET_PF'.
    ENDFORM.                    " display_tree
    *&      Form  pick
    *      -->COMMAND    text
    *      -->NODE       text
    FORM user_command    TABLES pt_nodes         STRUCTURE seucomm
                                 USING pv_command       TYPE c
                             CHANGING pv_exit        TYPE c
                                      pv_list_refresh  TYPE c.
      pv_list_refresh = 'X'.
      IF pt_nodes-tlevel = '03'.
        CLEAR t_fieldcat[].
        SELECT carrid
               connid
               fldate
               FROM sflight
               INTO TABLE t_sflight
               WHERE connid EQ pt_nodes-text.
        fs_fieldcat-col_pos = 1.
        fs_fieldcat-fieldname = 'CARRID'.
        fs_fieldcat-seltext_m = 'Airlinecarrier'.
        fs_fieldcat-key = 'X'.
        fs_fieldcat-hotspot = 'X'.
        APPEND fs_fieldcat TO t_fieldcat.
        CLEAR fs_fieldcat.
        fs_fieldcat-col_pos = 2.
        fs_fieldcat-fieldname = 'CONNID'.
        fs_fieldcat-seltext_m = 'Connection No'.
        fs_fieldcat-key = 'X'.
        fs_fieldcat-hotspot = 'X'.
        APPEND fs_fieldcat TO t_fieldcat.
        CLEAR fs_fieldcat.
        fs_fieldcat-col_pos = 3.
        fs_fieldcat-fieldname = 'FLDATE'.
        fs_fieldcat-seltext_m = 'Flight Date'.
        fs_fieldcat-key = 'X'.
        fs_fieldcat-hotspot = 'X'.
        APPEND fs_fieldcat TO t_fieldcat.
        CLEAR fs_fieldcat.
        w_repid = sy-repid.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_callback_program = w_repid
            it_fieldcat        = t_fieldcat[]
          TABLES
            t_outtab           = t_sflight.
      ENDIF.
    ENDFORM.                    "pick
    *&      Form  set_pf
    *       text
    FORM set_pf.
      SET PF-STATUS 'MYPF'.
    ENDFORM.                    "set_pf

  • HT204291 My iPad 4 does not show up on my TV screen when in AirPlay mirroring mode using WiFi.  The iPad displays AirPlay set to TV with the Mirroring On (green).  My iPad IOS software is 8.2 and my Apple TV software is at 7.1.  The TV displays the Apple

    My iPad 4 does not show up on my TV screen when in AirPlay mirroring mode using WiFi.  The iPad displays AirPlay set to TV with the Mirroring On (green).
    My iPad IOS software is 8.2 and my Apple TV software is at 7.1.  The TV displays the Apple Menu.  The “Settings” does however displays the General menu allowing me to see:
    Apple software:          7.1 (7003)
    Apple TV:                   Model No. A1464, Part No. MD199B/A
    Signal Strength shows 5 circles.
    It does not display the iPad screen but when I use the BT Sport App I can hear the sound but there is no video.  I have searched the internet for a solution to no avail. The problem first arose when the IOS was at 8.1+ but it worked correctly briefly when I updated to IOS 8.2.  Can you help please?

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Check AirPlay is turned on on the Apple TV (turn it off and on if it already is)
    Check that both devices are on the same network (Settings > Wifi, on the mobile device and Settings > General > Network, on the Apple TV).
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router. (Also try removing it’s power cord for at least 30 seconds)
    Restart your mobile device.
    If you are still having problems, the following article(s) may help you.
    Troubleshooting AirPlay
    Troubleshooting Wi-Fi networks and connections
    Recommended Wi-Fi settings
    Wifi Diagnostic Software (for Mac users)
    You may also find some help on this page, where I’ve collected some of the more unusual solutions to network issues.
    When making adjustments to your network for better optimisation, you may find some of the points mentioned on this page helpful.

  • Displaying a set of records using jstl

    hi i am new to jstl.my requirement is i want to display a set of records from my database using jstl.for eg i want to display 50 records per page and i want to navigate to other records using next and prevoius buttons and i need to put view and edit buttons in that page.can anybody give me a solution for this.urgent

    You may try the paging taglib ...
    http://www.servletsuite.com/servlets/pagertag.htm

  • Display variable setting in Solaris 8

    Hi guyz,
    I am using the telnet session to start the application. In this case, I can't able to start because of Display variable setting.
    My problem is, I can telnet from my localsystem to the Server-A. Only from Server-A, I can telnet to Server-B where my applications are.How to set Display settings in this case?
    Please help me guyz.
    With regards,
    Amin

    Hello,
    how to set a variable depends on the shell. If you use the command 'uname -n' it will return the name of your system, which can in turn be resolved to the ip-address.
    C-shell (csh) setenv `uname -n`:0.0
    Bourne-shell (sh) set DISPLAY=`uname -n`:0.0; export DISPLAY
    Korn-shell (ksh) export DISPLAY=`uname -n`:0.0
    Best regards
    Michael

  • Display brightness setting doesn't stick on power cycle

    The display brightness setting doesn't seem to stick during power cycles on my new 13" i7, it almost always sets itself to full brightness when I turn it on. This isn't really a huge deal but it is kind of a nuisance as I typically keep it around half, why should I be turning it back down every time I boot up???.
    I have un-checked the box through settings for adjusting brightness based on ambient light, and made sure it is in fact staying un-checked.
    I have also reset PRAM a few times now which seems to provide a temporary fix only. After a day or two it's back to square one again.
    Any ideas, or is this a bug that there's currently no fix for?

    Quote from: zankou on 11-June-13, 23:02:54
    Hi, I have recently bought GE60-0ND notebook with Win8 preinstalled which I got rid of in a second I got home, reinstalled with my licensed Win7. Half of things didn't work so I flashed the correct firmware. From that point on everything works perfectly, only brightness control is broken. I simply cannot control my monitor's brightness with my special keys nor in power control setup. So I googled.. and some smart guy recommended a bios flash as well. But when I try, it says either "Problem getting flash information" or "Problem getting bios information".
    Any thoughts how to get the brightness control work?
    Thanks for any kind of advice 
    Did you switch the BIOS and the EC Firmware to the Windows 7 counterparts?
    You may want to ask Svet about that error.

  • From Nested Sets to Trees

    Hi All
    I need to construct a tree in java objects out of a table that has a nested set ( Joe Celko ) .
    I have the table
    Products
    ProductID number primary key
    Left number
    Right number
    A wanted to construct a tree base on the following
    class Product {
    Integer ProductID;
    Product left;
    Product right;
    Does anyone know of a example/tutorial that explains this
    thanks

    Ps one product can have two childern , left and right , No more

  • I have update ios5.1 now wifi does not working and wifi hotspot does not displaying in setting

    Dear All,
    I have update ios5.1 last week on my iphone4 16GB. Now Wifi is not working and Wifi Hotspot not displaying in setting menu.
    Pls help. What can i do now
    Senthil

    Can you tap the little "i" in the blue circle and "Forget this Network"

  • 한글이 ??? 로 DISPLAY 되는 경우(CHARACTER SET)

    제품 : SQL*PLUS
    작성날짜 : 1996-07-02
    한글이 ??? 로 DISPLAY 되는 경우(CHARACTER SET)
    =============================================
    Oracle Tools(SQL*Plus, Forms 30, Forms 40, Reports 20 등)을 이용하여 한글
    DATA를 조회할 때 ???로 출력되는 경우 해결 방법.
    DATABASE는 SQL COMMAND 'CREATE DATABASE'를 포함하는 STATEMENT를 수행할
    때 만들어지는데 우리가 그 STATEMENT를 수행하기 앞서 고려해야 할 사항 중의
    하나가 DB CHARACTERSET이다.
    DB를 CREATE할 때 DATABSE CHARACTERSET을 명시해야만 하는데, 한번 선택되고
    난 후에는 CHARACTER SET을 변경하는 것은 쉽지가 않다.
    DATA DICTIONARY에 있는 DATA를 포함해서 모든 DATA는 선택된 CHARACTERSET에
    의해 입출력 되기 때문에 USER가 다른 CHARACTERSET으로 ACCESS한다면 한글 데이
    타가 ???로 출력된다.
    또한, 분산 DB 환경이나 UPGRADE할 경우에는 DATABASE CHARACTERSET이 같아야
    하므로, 사용자들은 DATABASE의 CHARACTERSET을 알아 두어야 한다.
    < 현재 DATABASE 의 CHARACTERSET 확인 및 변경 >
    1. 데이타베이스 CHARACTERSET 확인
    $ sqldba lmode=y
    SQLDBA> connect internal
    SQLDBA> select * from v$nls_parameters;
    PARAMETER VALUE
    NLS_CHARACTERSET KO16KSC5601 (or US7ASCII)
    (A)
    2. 환경 변수의 NLS_LANG 확인
    $ env
    NLS_LANG=American_America.US7ASCII
    (B)
    위의 (A)와 (B)가 동일한 경우에만 한글 데이타 처리에 문제가 없으며, 이것이
    서로 다른 상태에서 한글 데이타를 조회할 경우에는 ??? 로 출력 된다.
    3. CHARACTERSET을 일치시키는 방법
    * NLS_LANG 환경 변수를 변경하여 일치시키는 방법
    <UNIX>
    Bourne shell, k-shell을 사용하는 경우 .profile을 수정한다.
    NLS_LANG = American_Amerca.KO16KSC5601; export NLS_LANG
    c-chell을 사용하는 경우 .cshrc 혹은 .login 수정
    setenv NLS_LANG American_America.KO16KSC5601
    수정 후 다시 $env를 실행하여 변경되었는지 확인한다.
    <WINDOWS 3.1>
    C:\WINDOWS\ORACLE.INI 수정
    NLS_LANG=American_America.KO16KSC5601
    WINDOW 재기동
    <WINDOWS 95>
    WINDOWS 95에서는 NLS_LANG이 ORACLE.INI에 들어있지 않고
    REGISTRY에 기록되므로 REGISTRY EDITOR를 이용하여 수정해야 한다.
    MS DOS 창으로 나가서 REGEDIT.EXE 실행
    또는
    시작 -> 실행 -> regedit -> HKEY_LOCAL_MACHINE -> SOFTWARE -> ORACLE
    오른쪽 마우스 버튼을 이용하여 NLS_LANG을 수정한다.
    REGISTRY 변경 후에 PC를 REBOOTING 할 필요는 없습니다.
    <WINDOWS NT>
    WINDOWS NT 에서도 WINDOWS 95의 경우와 마찬가지로 REGISTRY에 기록된
    정보를 변경해 주면 됩니다. 다음과 같이 합니다.
    DOS 창에서 REGEDT32.EXE 실행
    HKEY_LOCAL_MACHINE -> SOFTWARE -> ORACLE 선택
    메뉴를 선택하여 NLS_LANG을 수정
    * 서로 다른 character set 을 갖는 DB를 access 하는 client에서는 다음과
    같은 setting 을 하면 편리합니다.
    예를 들어서 SERVER의 character set이 US7ASCII이고 PC의 NLS_LANG이
    American_America.KO16KSC5601과 같이 서로 다르게 설정되어 있는 경우
    다음을 각 client의 환경에 추가하면 한글 문제가 해결됩니다.
    ORA_NLS_CHARACTERSET_CONVERSION=NO_CHARACTER_SET_CONVERSION

    두 디비가 다른 캐랙터 셋을 쓴다고 해도
    디비 자체에는 문제가 없다고 보는데 말이죠..
    두 플렛폼을 비교한번해보시고요.
    그래도 문제가 생긴다면 님 말씀 대로 바꿔보심이.
    위에건 그냥 보시라는거고
    중요한건 imp,exp할때 약간 조정이 필요할거 같은데 말이죠.

  • Y/t chart stops showing data depending on Maximum Display Range setting

    The y/t graph will not display any data if I increase the Maximum Display Range setting to .8000s or higher.  The data in the file is at 5000 Hz, is this part of the problem?  I have played around with the Time Base and Measurement setting to no avail. The data is arbirary in length, but will not be longer than 3 seconds.
    Solved!
    Go to Solution.

    Here's the scoop...
    You have 145 blocks of data in the file. Fewer than that are sent through the Relay00.
    When you configure the Y/t Chart for more blocks than you have, then it waits for the rest of the blocks to come in. And they are not going to come in.
    One workaround is to use the "Fast Recorder" mode of the Y/t Chart, but your block size is too small (50 vs 128 minimum).  
    I'd suggest switching to the Chart Recorder module - configure it like this... and then, because you want the trigger to reset the time to 0, use an Action module. 
    Configure the Action like this... it will reset the Chart to start at 0 each time the trigger opens the Relay.
    - cj
    Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.

  • Click on J button to display record set

    How to write a code to click o j button to display record set of MS Access database

    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    Create a class to perform DB related stuff and call in when the button is clicked. Your question is too generic. It would be better if ou asked a specific query.

  • Frmf2xml.sh: why do i need a display variable set to transform fmb to xml?

    hallo,
    why do i need a display variable set to transform fmb to xml with a shell script (frmf2xml.sh) ?
    OS: SunOS 5.10
    Oracle Forms Developer: 10.1.2
    thank you
    christian

    Hi DrClap,
    I just wanted to check with you whether I understood your comment correctly.
    It's not possible to directly specify a physical file location path, like it is specified for HTTP URL +<c:import url= http://...+, that would internally/automatically convert in one of the form - Reader, Source, Document, String.
    It can only be produced/specified explicitly in one of the form - Reader, Source, Document, String.
    Am I correct in my understanding?
    Regards,
    Gnanam

  • PO print preview displays incorrect setting in decimal places

    Dear Experts
    Please help me on the following condition.
    I have a problem in print preview of a PO. It displays the incorrect setting for decimal place in currency.
    It shows USD 1.404,00 whereby the amount should be USD 1,404.00
    This only happens to a certain vendor that is doing PO for the first time from that country
    Example:
    I'm creating a PO for vendor 123. Vendor 123 is located in country A. No PO has been created for any
    vendor in country A before. When I saved my PO, in print preview, the decimal setting is not correct.
    But when I'm creating another PO, for vendor 234. Vendor 234 is located in country B. There have been
    several POs created for vendors in country B before. When I saved my PO, in print preview, the decimal
    setting is correct.
    Both vendor 123 and vendor 234 is using currency of USD.
    Is there any other setting with the vendor master in regard with the currency decimal setting for each
    country for the vendor? Or something that I've missed out?
    Diagnosis:
    I've checked with the user profiles->default-> decimal notation. It displays 1,234,567.89 correctly
    I've also run OY04, but the decimal setting is correct.
    Thank you
    Regards
    Syukri

    this has nothing to do with print preview, it is just basic country setting (OY01) how a quantity and value is written on a PO to a vendor is country xyz.
    German uses to comma to seperate decimals, while USA uses the point to seperate decimals
    this would be the German version 1.404,00, and this the US version:: 1,404.00
    so if an American sends a PO to a German vendor, then the document will show 1.404,00 so that the German can understand that he wants 1404. (and not 1000 times less)

  • Error while displaying Transport Sets

    Dear All
    I just imported a portal page group using import utility.
    Now after this, when I click on Transport set name in Portal builder, it display
    Error: Transport Set mycompany does not contain any objects. (WWU-52926)
    Can you guys please tell me where is the mistake.
    Morover, I am looking for a sample portal page group (script file and export dump file), that I want to deploy. So if anyone can please send me, I will really appreciate.
    Neeraj

    Hi Yogesh,
           I haven't installed any patch on my client machine.
                                                                                    Regards,
                                                                                    Dilip Kumbhar

  • Display resolution setting

    Somehow I changed the resolution setting for the display on my MacBook. Now I'm not sure what to set it. I currently have it on 1280 X 800, but I'm not sure that is right. Any help will be appreciated.

    I've been dealing with the same issue. I can tell you if you go into start, control panels, displays, settings and change the display to the next setting down - maybe 1280 x 769 (guessing) you will get a much crisper display. My question is how do you keep those setting so you don't have to reset the display each time you boot to XP???
    Good luck,
    Bill

Maybe you are looking for

  • Query refreshing problem

    Hi All ,                   We got this message when refreshing a detailed query from PA in an existing work book                                 RFC_ERROR_SYSTEM_FAILURE                                 error : No roll memory of length 86716416  avail

  • Trouble with CR2 and converting to DNG

    I am new at using camera raw files.  I recently got a Canon EOS Rebel XS/1000D as well as Adobe Lightroom 3.  I tried loading my CR2 files into Lightroom by "copying as DNG."  Once I did this, the program said "the files are from a camera which is no

  • Normal behavior in Start Up Manager?

    I have several volumes in use at any time, so I boot into the Start Up Manager (option key) quite a bit. In the past, this screen displayed the names and corresponding icons of the available volumes (e.g., Macintosh HD, Media, whatever), but in 10.6.

  • ATV keeps on re-syncing. Caution file deleters

    I made 2 changes, 1 of which changed the syncing behavior of my ATV. 1. I upgraded to version 2 2. I synced 1 of my smart music play lists Now whenever I open iTunes it tries to sync to ATV, syncing 1 or 2 TV shows that I haven't watched yet and have

  • Where is the iTunes Side Bar in ver12. I hate not having the Side Bar!@

    Where is the iTunes Side Bar in ver12. I hate not having the Side Bar!@ Continually feel like I am in Apples 1984 video, except Apple replaces IBM as the "Big Brother", lets all walk in lock step to the Apple Reich! Give us back the iTunes side bar A