Categories
4.1 ApEx Bug Oracle Pagination

Oracle Application Express 4.1 pagination number of rows resets to 15 bug

So you create what appears to be a simple classic SQL report region. It contains a lot of rows so you specify a pretty high number in the “Number of Rows” value under “Report Attributes” “Layout and Pagination”. In this example, I set it to 100.

Layot and Pagination Number of Rows
Layot and Pagination Number of Rows

You run the report and all looks well… until you click “Next >” to get the next page!

ApEx report first page
ApEx report first page

All of a sudden, the number of rows dwindles back down to 15 and it stays that way! Imagine trawling through thousands of rows 15 at a time. How annoying!

Oracle ApEx report next page
Oracle ApEx report next page

Luckily for us, the patch fix is simple. All you have to do is:

1. Create a Hidden Item for the page where your report is.
2. Under source -> Source Used, set the Source Used to “Always, replacing any existing value in session state.
3. Under Source -> Source Type, leave the value set to “Static Assignment (value equals source attribute).
4. Under Source -> Source value or expression, set the number you would like for the number of rows. In this instance, I set it to 100.

New hidden page item source
New hidden page item source

5. Apply changes then go to your report’s Report Attributes – Layout and Pagination. Under Number of Rows (item), enter you hidden item name.

Oracle ApEx report attributes' Layout and Pagination Number of Rows (Item) value
Oracle ApEx report attributes’ Layout and Pagination Number of Rows (Item) value

6. Apply changes, and the problem should be fixed

Categories
ApEx Bug Oracle

Oracle ApEx 4.1 Incorrect Sort Order Image for Classic Reports

We recently upgraded our Oracle ApEx installation to 4.1. No major issues but a significant annoyance is that when you click on a sortable column on a classic report, the sort image (up and down arrow/pointers) are reversed. It appears that the problem is currently not patched by Oracle, but fortunately, there’s a workaround which works quite nicely and I’ve provided step by step instructions here with screen shots.

There are three main steps to apply the workaround. First step is to add a JavaScript to your page template.

Step 1. Add JavaScript

  • Login to Application Express
Login to Oracle Application Express
Login to Oracle Application Express
  • Click on “Application Builder”
  • Click on the application you want to modify
  • Click on “Shared Components”
  • Under “User Interface”, click on “Templates”
  • In the list of templates, scroll down to “Page” and edit the default template (indicated by a tick)
Edit Default Page Theme
Edit Default Page Theme
  • Paste the following javascript in the Header definition just before the closing head tag (</head>):

<script type="text/javascript">
<!--
function correctStdReportSortImage(pThis){
var $img = pThis instanceof jQuery ? pThis : $(pThis);

//Only run the code if the image actually exists.
//Since this code will be listening to the entire document’s refresh events it could get other events (such as IR)
if ($img.length > 0) {
//If the href has ‘desc’ in it then make sure the image is ascending as the presence of “desc” means column is sorted asc
$img.attr(‘src’, $img.parent().children(‘a’).attr(‘href’).indexOf(‘desc’) > 0 ? $img.attr(‘src’).replace(‘down’, ‘up’) : $img.attr(‘src’).replace(‘up’, ‘down’));
}
}//correctStdReportSortImage
//–>
</script>

Paste Code in Header
Paste Code in Header
  • Apply changes then click on “Application Builder”

Step 2. Add First Dynamic Action on Page 0

  • Click on the application you want to modify
  • Click on page 0 to edit it. If you haven’t created page zero, you need to create one. Instructions on how to create page 0 can be viewed here.
Click Page 0
Click on Page 0
  • Under “Dynamic Actions” click on the icon to add a new action
Add New Dynamic Action
Add New Dynamic Action
  • Click on “Advanced”
Click On Advanced
Click On Advanced
  • Type in a name (anything will do, for this example I typed in “Page Sort Image Fix Page Load”) then click on the “Next >” button
Type in Dynamic Action Name
Type in Dynamic Action Name
  • Under “Event” select “Page Load”, leave condition as is then click on the “Next >” button
Select Page Load Event
Select Page Load Event
  • Under “Action” select “Execute JavaScript Code” then paste the following JavaScript into “Code”:

$(this.affectedElements).each(function(){
correctStdReportSortImage(this);
});

Select Execute JS Code
Select Execute JS Code
  • Click Next
  • Under “Selection Type” select “jQuery Selector” then paste the following text under “jQuery Selector”:

.rpt-sort img

jQuery Selector
jQuery Selector
  • Click on the “Create” button

Step 3. Add Second Dynamic Action on Page 0

  • Under “Dynamic Actions” click on the icon to add a new action
  • Click on “Advanced”
  • Type in a name (anything will do, for this example I typed in “Page Sort Image Fix After Refresh”) then click on the “Next >” button
Type in 2nd Dynamic Action Name
Type in 2nd Dynamic Action Name
  • Under “Event” select “After Refresh”
  • Under “Selection Type” select “DOM Object”
  • Under “DOM Object” enter the following text:

document

After Refresh Action Parameters
After Refresh Action Parameters
  • Leave condition as is then click on the “Next >” button
  • Under “Action” select “Execute JavaScript Code” then paste the following JavaScript into “Code”:

correctStdReportSortImage($(this.browserEvent.target).find('.rpt-sort img'));

2nd Dynamic Action JS
2nd Dynamic Action JS
  • Click Next
  • Leave “Selection Type” as is then click on the “Create” button

That’s it. Good luck.

Categories
ApEx Bug Oracle

“Typo” in Oracle ApEx Manage Services Page

Could a developer in Oracle please fix the “typo” in the Manage Services page in Oracle Application Express. I’ve been looking at the error for some time now and was hoping that it will be fixed on the latest ApEx version. Well, I’m looking at version 3.2 and it’s still there. I’m sick of looking at it now so can someone in Oracle please fix it.

The error can be found under Home -> Manage Services. Under the Workspace region, there’s an item that spells “Request Service Terminiation”… I think it should say “Request Service Termination”.

Request Service Terminiation

If I am wrong, I apologize. If I’m right, please fix it because I hold such high regard for Oracle and I don’t want to see them reduced to “human” status by appearing to make such human-like mistakes.

Thank you Oracle.