I had a request from a user that I add tooltips to an interactive report I’d built, so that users could hover over a column and get a description. Now, I try to name my columns clearly, but sometimes you need a little extra explanation, so this seemed a fairly reasonable request, and I went hunting for an answer.
When you edit a column of an interactive report, one of the things you can specify is the help text. Now, for a normal page item, the help text is displayed when a user clicks on the label (assuming you’re using one of the “with help” label templates, of course). So I was hopeful that APEX would do something similarly cool with the help text for a column–maybe have it as a tooltip when you hover over the column heading, or maybe display it in the box that opens when you click on a heading that also has the sort & filter options. That’d make sense, wouldn’t it?
Unfortunately, it doesn’t work that way. As far as I can tell, APEX blithely ignores everything you put into the help text field. It’s definitely not in the source code for the page, but that’s not surprising; APEX uses an AJAX call to get the help for page items–if you look at your page source, you’ll see
But, of course, there’s nothing similar in the source for an interactive report (that’d be too easy, I guess). So I gave up on the help text route, and started looking for alternatives.
- Set the link text to be your column’s value (#COLUMN_NAME#).
- Set the link attributes to:
onmouseover="toolTip_enable(event,this,'Something helpful.')" style="text-decoration:none;cursor:default;"
I added the style tag so that it doesn’t look like a link; if you’re already using the column as a link, you probably don’t want this.
- If you’re not using it as a link, you still need to give it a target so that APEX will render it. Set the Target to URL; for the URL, just use #–it won’t trigger a page reload if the user clicks it.
And you’re done! Note that this actually puts the help text on the values in the column, so you could easily have context-specific help; you can refer to columns in your report with the #COLUMN_NAME# syntax. Nifty and powerful–just the way I like it!