Wow a real APEX posting can you believe it?


So I got an email from Alistair Laing asking about a certain example of mine , (AJAX) Report Pull.


He rightfully pointed out that if you used one the AJAX enabled report templates the AJAX pagination worked but the sorting wouldn't work, sometimes.

The reason for this is that the AJAX templates are a HACK! That's right I said it ,I can because I built them, sure they are a successful , well used, robust HACK but a HACK none the less.


The issue with the sorting not working is because the header links are rewritten when the page loads so that the headers no longer have normal links but have AJAX enabled links. The pagination doesn't have this issue because the AJAX code is hardcoded in and to make matters worse if you paginate first then the sorting does get rewritten to be AJAX, I told you it was a HACK.

But have no fear with just a little bit more effort you can make it sorting work as it should , Ajax Region Pull & Pagination

There are a few differences between the first example and the second example.

The main part being the javascript code on the pulling page (149)

On the report page (150) create a Before Header Reset Pagination Process that resets the pagination if the REQUEST is RP

On the Report Region put <clip> in the Region Header and </clip> in the Region Footer.

There are a few other ways to do this but this is the way that most closely mirrored the original example.

I have updated my Example Application Export so this is there to dig through.

Something to look forward to.

In 3.1 all of this has been fixed with the inclusion of one SUPER EXCITING new declarative report attribute.



I mean look at that! It's a thing of beauty isn't it ;) and better yet it supports all of APEX's pagination types.



EDIT: if you cut and paste the code snippet you will get all the code. I need to adjust the layout of this blog or get one of those nifty code highlighting javascript widgets.

3 Comments:

  1. Tim... said...
    Hi.

    Was this functionality pulled from the production release of 3.1?

    I can't see that property on my reports screens.

    Cheers

    Tim...
    Crystal said...
    Hi Carl,

    I tried to look up the AJAX PAGINATION setting but couldn't find any (APEX 3.1.2)

    Whenever I press the pagination link for the next page I get 'undefined'

    Your support will be highly appreciated.

    Kind regards
    Tapps
    pay per head call center said...
    Your blog is very interesting and your way of writing is also very good.

Post a Comment