6 Replies Latest reply: Oct 11, 2012 6:07 AM by Mahmoud_Rabie RSS

    How to create a List for the 2nd level tabs

    Mahmoud_Rabie
      Dear Experts

      I have created a view
      CREATE OR REPLACE FORCE VIEW  "MY_VW_TABS" ("APPID", "PTTARGET", "PTTABNAME", "PTTABLABEL", "TABNAME", "TABLABEL", "TABPAGE") AS
        select pt.APPLICATION_ID APPID,pt.TAB_TARGET PTTARGET,pt.TAB_NAME PTTABNAME,pt.TAB_LABEL PTTABLABEL,t.TAB_NAME TABNAME,t.TAB_LABEL TABLABEL,t.TAB_PAGE TABPAGE
      from APEX_APPLICATION_PARENT_TABS pt,APEX_APPLICATION_TABS t
      where t.tab_set = pt.TAB_NAME
      and pt.APPLICATION_ID=t.APPLICATION_ID
      order by pt.TAB_NAME,t.TAB_NAME
      I need to create a dynamic list based on this view for the *2nd level of tabs* (of my two-level tabs page template) , to be used in a sidebar region in page 0. However, I found the code of the list should be as the following:
      select level, labelValue label, 
             [targetValue]            target, 
             [is_current]             is_current_list_entry,
             [imageValue]             image, 
             [imageAttributeValue]    image_attribute,
             [imageAltValue]          image_alt_attribute,
             [attribute1]             attribute1,
             [attribute2]             attribute2,
             [attribute3]             attribute3,
             [attribute4]             attribute4,
             [attribute5]             attribute5,
             [attribute6]             attribute6,
             [attribute7]             attribute7,
             [attribute8]             attribute8,
             [attribute9]             attribute9,
             [attribute10]            attribute10
      from ...
      where ...
      order by ...
      Now, I have two questions:
      1) How to employ the above view to be used in the dynamic list code?
      2) Is this a good way to create a list for the 2nd level tabs?

      Best Regards
      Mahmoud
        • 1. Re: How to create a List for the 2nd level tabs
          Prabodh
          Hi Mahmoud,

          To get multi-level list you need the Level item to contain a value, which in turn means the use of CONNECT BY.. START WITH clause. It like any other tree or hierarchical query.

          You will find the example on the Create Dynamic Lists wizard's Create List page. It goes like this.
          Example 3 (using hierarchical SQL query):
          
          select level, 
                 ENAME label, 
                 'f?p=&APP_ID.:1:'||:APP_SESSION||'::::P1_EMPNO:'||empno target,
                 'NO' is_current,
                 '#APP_IMAGES#del.gif' image
          from EMP
          start with MGR is null
          connect by prior EMPNO = MGR
          order siblings by ENAME
          If your objective is to display the existing Tabs (hierarchical) as a List then you use the Apex Views. If you do not use Tabs then you might be better off using a custom table for the List(s).

          Cheers,
          • 2. Re: How to create a List for the 2nd level tabs
            Mahmoud_Rabie
            Dear Prabodh,

            Thank you for you response.

            Only I need a list for the second level tabs since I have the first level on the top navigation area of my page template

            As I understood, I wrote the following code for the list
            SELECT null, 
                   TABLABEL label, 
                   'f?p=&APP_ID.:' || TABPAGE || ':'||:APP_SESSION||':::::' target, 
                   (CASE  
                        WHEN TABPAGE = :APP_PAGE_ID THEN 'YES' 
                        ELSE 'NO' END) is_current
            from MY_VW_TABS
            WHERE PTTABNAME in (select TAB_SET from APEX_APPLICATION_TABS where TAB_PAGE = :APP_PAGE_ID)
            In page 0, I created a list region with template (Vertical Unordered List without Bullets), however, it is not displaying anything!!

            What is missing to get list displayed?

            Best Regards
            Mahmoud
            • 3. Re: How to create a List for the 2nd level tabs
              Prabodh
              Hi,
              You mean you have defined 2 level tabs, use One level tabs on pages and want to display the second level as a Dynamic List ?

              Cheers,
              • 4. Re: How to create a List for the 2nd level tabs
                Mahmoud_Rabie
                want to display the second level as a Dynamic List ?
                Yes, exactly.

                How to achieve it?
                • 5. Re: How to create a List for the 2nd level tabs
                  Nicolette
                  Mahmoud

                  Are you sure that you're view is correct?

                  >
                   where t.tab_set = pt.TAB_NAME
                   
                  Should be
                  where t.tab_set = pt.current_for_tabset
                  Nicolette
                  • 6. Re: How to create a List for the 2nd level tabs
                    Mahmoud_Rabie
                    Dear      Nicolette

                    Thanks alot. Now, it works :)

                    And thanks alot for Prabdoh

                    Best Regards
                    Mahmoud