I ran into one of those frustrations today with APEX 4.0. Whilst the introduction the region display selector has been very welcomed, I had the requirement for it to be sticky, i.e. remembered across page refreshes. Unfortunately this functionality is not available, but it is available in the APEX builder application just to rub our faces in it
Now my first port of call was to hit the forum and to my surprise no-one has posted a solution even though there have been several threads on the topic. So I had one of the moments where I contemplated being lazy and wait for a future release, but being someone who thrives on challenges (no matter how small) I thought I’d try my luck with a couple of dynamic actions to solve the problem. (I did think about writing a plugin, but it’s probably overkill for this requirement)
So here are the steps:
- Create a (non protected) hidden page item to hold the active region value of the region display selector
- Create the following dynamic action “Advanced -> Page Load”
- and for the true action
- Create a second dynamic action “Avanced -> Click”
- for the first true action
- for the second true action
The most optimal solution is probably to create an item and define these 2 dynamic actions on page zero and use a condition with an exists query that checks the APEX data dictionary to see which pages a region display selector defined on them. Or simply set a condition of a comma delimited list of pages etc. whichever works best for your situation.
A couple of months ago I had a request to create a “Freeze Columns” dynamic action plugin for an interactive report which behaved like the following demo. Whilst I wasn’t sure whether it would be possible I knew that in APEX 4.0 we had some event hooks such as “After Refresh” which we could bind a dynamic action to. We could use this event to manipulate the Interactive Report HTML after every refresh to produce the required layout. Whilst the initial prototype was quick to implement, mainly thanks to jQuery, there were a number of challenges which I faced:
- Cross browser and version support since different flavours of IE handled the positioning of scrollbars differently. Achieving equal row heights when splitting the report into two HTML tables was tricky, each browser seemed to behave a little different.
- The header drop down menu’s would be placed incorrectly when horizontal scrolling occurred on the unfrozen set of columns, which unfortunately wasn’t as simple as the usual workaround for relative positioning.
After resolving the above and the addition of several enhancement requests i.e. adding in additional vertical scrolling whilst freezing the header (see this demo) and making it work with Clarifit’s existing column grouping plugin (demo), I’m proud to announce the release of publicly available commercial package to perform all 3 cosmetic changes in combination or independently of each other. Here’s a screenshot to give you a visual of the plugins in action:
Here’s a YouTube video which walks you through how to combine all 3 dynamic actions on the same interactive report.
Lastly here’s the demo application to see them in action, and download page. The added extra is that, thanks to the release of APEX 4.1 on apex.oracle.com last Friday, I have been able to certify the package against this new release of APEX