12 Replies Latest reply: Dec 18, 2012 1:18 PM by sect55 RSS

    Dynamic List - Is Current Issue

    sect55
      I created a dynamic list. It works except for the IS_CURRENT parameter.
      List : dyn wizard page 11
      Template:      Wizard Progress List, Horizontal Train
      
      Query Source Type: Function Returning SQL Query
      
      Query
      
      case
      when :APP_PAGE_ID = '11' THEN
        RETURN 
        'SELECT null, progress_name label, '||
        'case WHEN NVL(:APPL_TAB_NAME,''PROJECT'')=CURRENT_TAB_NAME THEN ''Y'' else ''N'' end 
       is_current_list_entry,'||
        'null,null,id ' ||
        'FROM csrsr_req_wizard_nav '||
        'WHERE form_number_id = 3 ORDER BY 6';
      when :APP_PAGE_ID = '8' THEN
        RETURN 
        'SELECT null, current_tab_name label '||
        'FROM csrsr_req_wizard_nav '||
        'WHERE form_number_id = 1 ORDER BY 1';
      when :APP_PAGE_ID = '10' THEN
        RETURN 
        'SELECT null, current_tab_name label '||
        'FROM csrsr_req_wizard_nav '||
        'WHERE form_number_id = 2 ORDER BY 1';
      else
        RETURN 
        'SELECT null, current_tab_name label '||
        'FROM csrsr_req_wizard_nav '||
        'WHERE form_number_id = 4 ORDER BY 1';
      END CASE;
      The page I am accessing the dynamic list is Page 11.

      Can someone help please?

      Robert
      http://apexjscss.blogspot.com
        • 1. Re: Dynamic List - Is Current Issue
          VC
          Robert,

          It is clear what you are trying to do...but what is the problem?

          VC
          • 2. Re: Dynamic List - Is Current Issue
            sect55
            VC,

            The bullet for the current item is not highlighted. In the Oracle® Application Express Application Builder User's Guide, under Creating Lists, the third column of the query is the is_current parameter.
            is_current - Controls the behavior of the list entry. Values include:
            
                NULL - Currency of target is based upon Target URL.
            
                'YES' - List entry is always current.
            
                'NO' - List entry is not current.
            
            If 'YES', list entry is always current, if NO, list entry is not current.
            So I am trying to highlight the current list item by using is_current. All bullets are not highlighted.

            Robert
            http://apexjscss.blogspot.com
            • 3. Re: Dynamic List - Is Current Issue
              VC
              sect55 wrote:
              VC,

              The bullet for the current item is not highlighted. In the Oracle® Application Express Application Builder User's Guide, under Creating Lists, the third column of the query is the is_current parameter.
              is_current - Controls the behavior of the list entry. Values include:
              
              NULL - Currency of target is based upon Target URL.
              
              'YES' - List entry is always current.
              
              'NO' - List entry is not current.
              
              If 'YES', list entry is always current, if NO, list entry is not current.
              So I am trying to highlight the current list item by using is_current. All bullets are not highlighted.

              Robert
              http://apexjscss.blogspot.com
              But in your Case statement above you are returning Y/N, so change then to return YES/NO
              • 4. Re: Dynamic List - Is Current Issue
                fac586
                sect55 wrote:

                The bullet for the current item is not highlighted. In the Oracle® Application Express Application Builder User's Guide, under Creating Lists, the third column of the query is the is_current parameter.
                is_current - Controls the behavior of the list entry. Values include:
                
                NULL - Currency of target is based upon Target URL.
                
                'YES' - List entry is always current.
                
                'NO' - List entry is not current.
                
                If 'YES', list entry is always current, if NO, list entry is not current.
                The documentation says that values include 'YES'/'NO'. Your code has 'Y'/'N':
                case WHEN NVL(:APPL_TAB_NAME,''PROJECT'')=CURRENT_TAB_NAME THEN 'Y' else 'N' end 
                Have you tried 'YES'/'NO'?
                case WHEN NVL(:APPL_TAB_NAME,''PROJECT'')=CURRENT_TAB_NAME THEN 'YES' else 'NO' end 
                • 5. Re: Dynamic List - Is Current Issue
                  sect55
                  VC and fac586,

                  I tried it with YES/NO and it still does not highlight current item.
                  case
                  when :APP_PAGE_ID = '11' THEN
                    RETURN 
                    'SELECT null, progress_name label, '||
                    'case WHEN NVL(:APPL_TAB_NAME,''PROJECT'')=CURRENT_TAB_NAME THEN ''YES'' else ''NO'' end 
                   is_current_list_entry,'||
                    'null,null,id ' ||
                    'FROM csrsr_req_wizard_nav '||
                    'WHERE form_number_id = 3 ORDER BY 6';
                  when :APP_PAGE_ID = '8' THEN
                    RETURN 
                    'SELECT null, current_tab_name label '||
                    'FROM csrsr_req_wizard_nav '||
                    'WHERE form_number_id = 1 ORDER BY 1';
                  when :APP_PAGE_ID = '10' THEN
                    RETURN 
                    'SELECT null, current_tab_name label '||
                    'FROM csrsr_req_wizard_nav '||
                    'WHERE form_number_id = 2 ORDER BY 1';
                  else
                    RETURN 
                    'SELECT null, current_tab_name label '||
                    'FROM csrsr_req_wizard_nav '||
                    'WHERE form_number_id = 4 ORDER BY 1';
                  END CASE;
                  Robert
                  Robert
                  http://apexjscss.blogspot.com
                  • 6. Re: Dynamic List - Is Current Issue
                    VC
                    Robert,

                    Try hard-coding the value to YES and see if it works, If it doesn't work then check your List Template definition
                    • 7. Re: Dynamic List - Is Current Issue
                      sect55
                      VC,

                      I hard-coded YES and see it still doenst work. I use the same template for the static list and it works for it but it doesn't work for the dynamic list.
                      It is called Wizard Progress List, Horizontal Train (Theme #2 Builder Blue)
                      Template Class Wizard Progress List
                      
                      Before List Entry
                      <div class="horizontal-progres-list">
                      <ul>
                      
                      
                      Template Definition
                       
                      List Template Current
                      <li class="#LIST_STATUS#">
                       <span>#TEXT#</span>
                      </li>
                      
                      List Template Noncurrent
                      <li class="#LIST_STATUS#">
                       <span>#TEXT#</span>
                      </li>
                      Robert
                      http://apexjscss.blogspot.com
                      • 8. Re: Dynamic List - Is Current Issue
                        sect55
                        Gurus, et al.,

                        Any help please. The issue is still not resolved!!

                        Robert
                        http://apexjscss.blogspot.com
                        • 9. Re: Dynamic List - Is Current Issue
                          VC
                          sect55 wrote:
                          Gurus, et al.,

                          Any help please. The issue is still not resolved!!

                          Robert
                          http://apexjscss.blogspot.com
                          reproduce the problem on http://apex.oracle.com and share the guest login details

                          Cheers,
                          Vikram
                          • 10. Re: Dynamic List - Is Current Issue
                            sect55
                            VC,

                            I placed it on APEX.ORACLE.COM.

                            Workspace: RGWORK
                            Application: Application 33558 (CSRSR)
                            Page: 11
                            User: TESTER
                            Password: test123

                            Please ignore item label issue. Have not include new label template.

                            Robert
                            http://apexjscss.blogspot.com
                            • 11. Re: Dynamic List - Is Current Issue
                              fac586
                              The dynamic list queries you're generating are missing a column. Your queries have 6 columns:
                              SELECT
                                  null
                                , progress_name label
                                , case
                                    WHEN NVL(:APPL_TAB_NAME,'PROJECT') = CURRENT_TAB_NAME THEN 'YES'
                                    else 'NO'
                                  end is_current
                                ,null
                                ,null
                                ,id
                              FROM
                                  csrsr_req_wizard_nav
                              WHERE
                                  form_number_id = 3
                              ORDER BY
                                  6
                              The examples in the list wizard have 7:
                              SELECT null, 
                                     ENAME label, 
                                     null target, 
                                     'YES' is_current, 
                                     '#APP_IMAGES#del.gif' image, 
                                     'width="20" height="20"' image_attrib, 
                                     ENAME image_alt
                              FROM  emp 
                              ORDER BY ename
                              Although the <tt>target</tt> column is not used in a standard wizard progress list as it's not clickable, the column must still be included or the column values will be offset. APEX sees your <tt>is_current</tt> column as the <tt>target</tt> value, and your null <tt>image</tt> column as <tt>is_current</tt>. It's good practice to include all columns and alias them:
                              select
                                  null level
                                , progress_name label
                                , null target
                                , case
                                    nvl(:appl_tab_name, 'PROJECT') = current_tab_name then 'YES'
                                    else 'NO'
                                  end is_current
                                , null image
                                , null image_attrib
                                , null image_alt
                              from
                                  csrsr_req_wizard_nav
                              where
                                  form_number_id = 3
                              order by
                                  6
                              Also note that there's no <tt>APPL_TAB_NAME</tt> application item in this app, which will affect the results of this query: <tt>nvl(:appl_tab_name, 'PROJECT')</tt> will therefore always evaluate to "PROJECT".
                              • 12. Re: Dynamic List - Is Current Issue
                                sect55
                                fac586 ,

                                Thanks for reviewing my function. I missed that!. I tested on my company's APEX, it works great!

                                Thanks !

                                Robert
                                http://apexjscss.blogspot.com