3 Replies Latest reply on Jul 10, 2018 1:59 PM by klacey

    Dynamic Navigation Bar entries (using SQL based list)

    klacey

      Apex 5.1.4

      I suppose this is aimed at the Dev team really.

       

      Using a SQL statement to create the Navigation Bar entries - it puts all sub level entries underneath the last top level nav bar menu entry.

       

      The following post had a response from Patrick Wolf stating a bug (#23560509) and proposal to fix in 5.1.x

      Dynamic Navigation Menu works but Dynamic Navigation Bar does not

       

      Just wondering if this was fixed in 5.1.0 and regressed in 5.1.4 (I don't have a 5.1.0 environment to try)

       

      However: It is still "un-fixed" in 18.1

      Example App: https://apex.oracle.com/pls/apex/f?p=58832

       

      I'm not too worried as I have an alternate solution - but to all you clever chaps out there - is there a workaround?

      Can I manipulate the SQL below to help the ordering in the navbar?

       

      Example dynamic SQL as the Nav Bar list

      SELECT 1
           , 'Main 1'                 label
           , NULL                     target
           , NULL                     image
           , NULL                     attribute1
           , 'mainClass1'             attribute2
      FROM dual
      UNION
      SELECT 2
           , 'Main 1- Sub 1'          label
           , 'javascript:alert(''Main 1 - Sub 1'');' target
           , NULL                     image
           , NULL                     attribute1
           , 'main1SubClass'          attribute2
      FROM dual
      UNION
      SELECT 2
           , 'Main 1 - Sub 2'         label
           , 'javascript:alert(''Main 1 - Sub 2'');' target
           , NULL                     image
           , NULL                     attribute1
           , 'main1SubClass'          attribute2
      FROM dual
      UNION
      SELECT 1
           , 'Main 2'                 label
           , NULL                     target
           , NULL                     image
           , NULL                     attribute1
           , 'mainClass2'             attribute2
      FROM dual
      UNION
      SELECT 2
           , 'Main 2 - Sub 1'         label
           , 'javascript:alert(''Main 2 - Sub 1'');' target
           , NULL                     image
           , NULL                     attribute1
           , 'main2SubClass'          attribute2
      FROM dual
      UNION
      SELECT 1
           , 'Main 3'                 label
           , NULL                     target
           , NULL                     image
           , NULL                     attribute1
           , 'someClass'              attribute2
      FROM dual
      
        • 1. Re: Dynamic Navigation Bar entries (using SQL based list)
          fac586

          klacey wrote:

           

          Apex 5.1.4

          I suppose this is aimed at the Dev team really.

           

          Using a SQL statement to create the Navigation Bar entries - it puts all sub level entries underneath the last top level nav bar menu entry.

           

          The following post had a response from Patrick Wolf stating a bug (#23560509) and proposal to fix in 5.1.x

          Dynamic Navigation Menu works but Dynamic Navigation Bar does not

           

          Just wondering if this was fixed in 5.1.0 and regressed in 5.1.4 (I don't have a 5.1.0 environment to try)

           

          However: It is still "un-fixed" in 18.1

          Example App: https://apex.oracle.com/pls/apex/f?p=58832

           

          I'm not too worried as I have an alternate solution - but to all you clever chaps out there - is there a workaround?

          Can I manipulate the SQL below to help the ordering in the navbar?

           

          Example dynamic SQL as the Nav Bar list

          1. SELECT1
          2. ,'Main1'label
          3. ,NULLtarget
          4. ,NULLimage
          5. ,NULLattribute1
          6. ,'mainClass1'attribute2
          7. FROMdual
          8. UNION
          9. SELECT2
          10. ,'Main1-Sub1'label
          11. ,'javascript:alert(''Main1-Sub1'');'target
          12. ,NULLimage
          13. ,NULLattribute1
          14. ,'main1SubClass'attribute2
          15. FROMdual
          16. UNION
          17. SELECT2
          18. ,'Main1-Sub2'label
          19. ,'javascript:alert(''Main1-Sub2'');'target
          20. ,NULLimage
          21. ,NULLattribute1
          22. ,'main1SubClass'attribute2
          23. FROMdual
          24. UNION
          25. SELECT1
          26. ,'Main2'label
          27. ,NULLtarget
          28. ,NULLimage
          29. ,NULLattribute1
          30. ,'mainClass2'attribute2
          31. FROMdual
          32. UNION
          33. SELECT2
          34. ,'Main2-Sub1'label
          35. ,'javascript:alert(''Main2-Sub1'');'target
          36. ,NULLimage
          37. ,NULLattribute1
          38. ,'main2SubClass'attribute2
          39. FROMdual
          40. UNION
          41. SELECT1
          42. ,'Main3'label
          43. ,NULLtarget
          44. ,NULLimage
          45. ,NULLattribute1
          46. ,'someClass'attribute2
          47. FROMdual

           

          Order the list entries so that the sub-entries follow their parents:

           

          SELECT 1                        lvl
               , 'Main 1'                 label  
               , NULL                     target  
               , NULL                     image  
               , NULL                     attribute1  
               , 'mainClass1'             attribute2  
          FROM dual  
          UNION  
          SELECT 2  
               , 'Main 1 - Sub 1'          label  
               , 'javascript:alert(''Main 1 - Sub 1'');' target  
               , NULL                     image  
               , NULL                     attribute1  
               , 'main1SubClass'          attribute2  
          FROM dual  
          UNION  
          SELECT 2  
               , 'Main 1 - Sub 2'         label  
               , 'javascript:alert(''Main 1 - Sub 2'');' target  
               , NULL                     image  
               , NULL                     attribute1  
               , 'main1SubClass'          attribute2  
          FROM dual  
          UNION  
          SELECT 1  
               , 'Main 2'                 label  
               , NULL                     target  
               , NULL                     image  
               , NULL                     attribute1  
               , 'mainClass2'             attribute2  
          FROM dual  
          UNION  
          SELECT 2  
               , 'Main 2 - Sub 1'         label  
               , 'javascript:alert(''Main 2 - Sub 1'');' target  
               , NULL                     image  
               , NULL                     attribute1  
               , 'main2SubClass'          attribute2  
          FROM dual  
          UNION  
          SELECT 1  
               , 'Main 3'                 label  
               , NULL                     target  
               , NULL                     image  
               , NULL                     attribute1  
               , 'someClass'              attribute2  
          FROM dual
          order by
              2
            , 1
          

           

           

          The aim is for the entries to appear in the order that they would when using a hierarchical query with an ORDER SIBLINGS BY clause.

          • 2. Re: Dynamic Navigation Bar entries (using SQL based list)
            Scott Wesley

            That's a nice way of thinking about it.

             

            Using dynamic results to build menus can be tricky to get the right order, but that's all it's down to.

            I use them a lot, and I posted an example a while back

            Grassroots Oracle: CSS pull down menu using APEX List

            • 3. Re: Dynamic Navigation Bar entries (using SQL based list)
              klacey

              Thanks for that..

              I can use the "unused" attribute10 as the ordering column for the menu items to make both levels in this concept work dynamically

              Appreciated