Single Article

Interactive report column headings tooltip help

Category APEX Tricks

Here is how you can add tooltip help to interactive report column headings.

First go add help text to your interactive report columns. See Editing Interactive Report Column Attributes.

Next create page process to Process Point "On Load -After Header".

 

DECLARE
  l_sql VARCHAR2(32700);
BEGIN
  l_sql := '
  SELECT COLUMN_ALIAS,
    HELP_TEXT
   FROM APEX_APPLICATION_PAGE_IR_COL
  WHERE APPLICATION_ID = :APP_ID
    AND PAGE_ID = :APP_PAGE_ID
    AND HELP_TEXT IS NOT NULL
  ';

  HTP.p ('<script type="text/javascript">');
  -- Create JSON object.
  HTP.prn ('var gIrColHelp = $u_eval(''(');
  APEX_UTIL.JSON_FROM_SQL(l_sql);
  HTP.prn (')'');');
 
  HTP.p ('</script>');
END;

 

Create dynamic Action. Select Advanced

  • Name: Set Column Headings Title
  • Event: After Refresh
  • Selection Type: Region
  • Region: {select your report region}
  • Condition: No Condition
  • Action: Execute JavaScript code
  • Fire On Page Load: True
  • Code:
    $.each(gIrColHelp.row,function(i,jd){
     $($x(jd.COLUMN_ALIAS)).attr({"title":jd.HELP_TEXT});
    });
    
  • Selection Type: None

Now when you run page and hover mouse over interactive report column heading you can see help on tooltip.

See working example.

Comment Button

Comments

  • Jari Laine 25 Jul 2015  

    Hi Sergiu,

    Could you please create example about this to apex.oracle.com, and share developer login details to workspace?

    Regards,
    Jari

        
  • Sergiu 24 Jul 2015  

    Hi Jari,

    Yes, in some cases it's interfering with Apex 4.2 IR standard functions(like filter). Only in some environments I got this problem. In console appear some errors at the js function.

    But I managed to replicate this error every time, no matter if it's the primary application or the shadow one, just with this scenario:

    -submit the page forcing to show an error (with apex add error, inline with notification)

    -observe that the URL is changed ending with wwv_flow.accept

    -click Action->Filter

    -now the loading gif appears and the application remained stuck

    -check the console to see the error.

    After changing the js dynamic action to never, it works just fine.

    Hope this info helps.

        
  • Jari Laine 23 Jul 2015  

    Hi Sergiu,

    You mean it's interfering IR on APEX 4.2 or APEX 5?
    I have not faced any problems on APEX 4.2.

    Regards,
    Jari

        
  • Sergiu 22 Jul 2015  

    Hi,

    This works in apex 4.2, BUT is interfering with the IR standard functionalities. Sometimes, if you click on Actions->Filter, the loading gif appears and remains stuck.

        
  • Paul 15 Jul 2015  

    Jari-

    What can I say, you are the best. THANK YOU for the fast turn around and for re-writing the PL/SQL process which is working great.

    Note for other Apex 5 users:

    1) Jari re-wrote PL/SQL process for Apex 5

    2) He moved the PL/SQL process to the [Page] Post-Redering: After Footer event

        
  • Jari Laine 14 Jul 2015  

    Hi Paul,

    I did made change to your sample application. See page 3.

    APEX 5 use different id for column heading than previous version when you create new IR.
    What I did see, if you import app from older APEX version, then column heading id is column alias. But for new IR it is different.

    Also $u_eval function is moved to legacy JavaScript file. But that is not actually needed if my tests are correct.

    To get this working on APEX 5, you need change page process to

    declare
      l_sql varchar2(32700);
    begin
      l_sql := q'[
      select case when static_id is null then
       'C' || column_id
        else
        static_id
        end as column_alias,
        help_text
       from apex_application_page_ir_col
      where application_id = :app_id
        and page_id = :app_page_id
        and help_text is not null
      ]';
      htp.p ('<script type="text/javascript">');
      htp.prn (q'[var gIrColHelp = $.parseJSON(']');
      apex_util.json_from_sql(l_sql);
      htp.prn (q'[');]');
      htp.p ('</script>');
    end;

    Regards,
    Jari

        
  • Paul 13 Jul 2015  

    Jari-

    Thanks so much for posting this. I have an application built with the default template in apex v5 and am having issues. I have created a workspace. It includes a working example (which uses templates from a prior version of apex). Let me know what you might need to assist in getting the application with the v5 template to work.

    https://apex.oracle.com/pls/apex/f?p=84988

    user: jari pw: xxx

    workspace: xxx

    Note: Jari application does not work (current v5 templates). Application 41543 - Apex 4 Interactive Report Custom Pagination does work, but this uses "old" templates

        
  • Animesh 26 Feb 2013  
    Hi Jari, Fantastic Trick Thanks for sharing - Animesh     
  • Ivan 27 Nov 2012  
    Jari, Thank you, this helps a lot! Ivan     
  • Jari Laine 26 Nov 2012  

    Hi Ivan,

    Your IR region did not have template. If you do not set report region any template dynamic action do not fire on that region.

    I did set template to region and now tooltip works.

    Regards, Jari

        

Global Right Column

Search

Archives

Subscribe in a Reader