This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Nov 14, 2012 12:14 PM by Marc Sewtz RSS

Wrong sort order image for classic reports

user627969 Newbie
Currently Being Moderated
Hello,

I'm using Apex 4.1 and i have created a classic report. It's possible to change the sort column and sort order. The last used sort column and sort order is saved to be used the next time as default.

The next time the user is using this report the data is sorted on the right column and in the correct order. So far everything is working fine. But the image to indicate the sort order is always the 'opposite image': the report is last used with sort order 'ascending' and the next time the report is used the image for sort order 'descending' is displayed. This behaviour is also happening when pagination is used and the user goes to the previous or next set of records (the correct records are displayed).

I think it's a bug or am i doing something wrong?

I've made a working example on http://apex.oracle.com/pls/apex/. If you interested, please let me know.

Regards,

Richard



Edited by: user627969 on Jan 5, 2012 3:03 AM
  • 1. Re: Wrong sort order image for classic reports
    klsharpe Newbie
    Currently Being Moderated
    I have a similar complaint about the sort column header image. My development instance has been upgraded to 4.1.0.00.32 from 4.0.2.00.06.

    All classic report regions in my apps now show the arrow image direction opposite of my production apps' arrow images. The production apps show an up arrow image for the ascending sort selection.

    When these classic Report Attributes were initially defined in many past Apex versions (my oldest app dates to Summer 2005 - HTMLDB days), the Sorting Ascending/Descending images were left at the default selections.

    I looked closer at the values in those default settings and compared between my two instances and they are the same! It appears the down arrow has always been set for Ascending sort selection.
    Ascending Image: arrow_down_gray_dark.gif
    Descending Image: arrow_up_gray_dark.gif

    Was there an oversight corrected with v4.1 that the arrows now display what appears in the default settings?
    Thanks,
    Kelly
  • 2. Re: Wrong sort order image for classic reports
    klsharpe Newbie
    Currently Being Moderated
    bump for an answer to see if anyone is seeing reversed arrow images in v4.1 for upgraded apps.
  • 3. Re: Wrong sort order image for classic reports
    663501 Newbie
    Currently Being Moderated
    I have the exact same problem. We have default sorts (mostly ASC) but when the page loads, the down arrow icon is displayed (however the data is correctly sorted). When we click the column header, the data is updated, but the icon is not (it's "fine" though, because the data is now sorted DESC).
  • 4. Re: Wrong sort order image for classic reports
    Marc Sewtz Pro
    Currently Being Moderated
    Thanks for reporting this issue, there was a bug filed about this some time ago (Bug 10398077), which I've re-opened,
    Regards,
    Marc
  • 5. Re: Wrong sort order image for classic reports
    klsharpe Newbie
    Currently Being Moderated
    Thank you Marc.
    Kelly
  • 6. Re: Wrong sort order image for classic reports
    Martin Giffy D'Souza Oracle ACE Director
    Currently Being Moderated
    Hi Marc,

    I'm having the same issue in 4.1. I checked the Oracle Support ticket and the recommended workaround is to "Change the name of the images (down and dup.gif )". What should we change the names to?

    Do you know when a fix will be ready?

    Thanks,

    Martin
    -----
    http://www.ClariFit.com
    http://www.TalkApex.com
  • 7. Re: Wrong sort order image for classic reports
    Marc Sewtz Pro
    Currently Being Moderated
    Hi Martin,

    I don't think changing the images would actually solve this, seems to be an issue with PPR sorting, i.e. if you shift-reload your page after doing a PPR sort, it'll swap out the image. So you could turns off PPR and see if that gives you better results, but short of that, this might have to wait till 4.2.

    Regards,
    Marc
  • 8. Re: Wrong sort order image for classic reports
    Martin Giffy D'Souza Oracle ACE Director
    Currently Being Moderated
    Hi Marc,

    Until 4.2 is released I have the following fix:

    - Create a Dynamic Action
    - Event: Page Load

    - Action: JavaScript
    - Code:
    $(this.affectedElements).each(function(){
      this.src = this.src.indexOf('dup.gif') > 0 ? this.src.replace('dup.gif', 'ddown.gif') : this.src = this.src.replace('ddown.gif', 'dup.gif');
    });
    - Selection Type: jQuery Selector
    - jQuery Selector: .rpt-sort img

    Essentially I'm switching the up/down arrows on page load. After that the sorting, and arrows, are working properly. Do you see any issues with this approach?

    Thanks,

    Martin
    -----
    http://www.ClariFit.com
    http://www.TalkApex.com
  • 9. Re: Wrong sort order image for classic reports
    Marc Sewtz Pro
    Currently Being Moderated
    Hi Martin,

    Looks like your fix ensure that the arrow doesn't flip direction when reloading the page are navigating back to the page, i.e. what you see after sorting stays the same when you reload or revisit the page. However in my test case (using theme 21, with different image names), looks like the arrows are now consistently pointing the wrong way. I think the arrow should point up for A-Z and down for Z-A. Do you see the same behavior? But in any case, if you flip the images in the report attributes, and include your dynamic actions based fix, this should resolve this issue for the time being.

    Thanks,
    Marc
  • 10. Re: Wrong sort order image for classic reports
    Martin Giffy D'Souza Oracle ACE Director
    Currently Being Moderated
    Hi Marc,

    I checked the IR and your statement "arrow should point up for A-Z and down for Z-A" is what IRs are doing.

    I looked into the problem a bit more and was able to narrow it down:

    - On Page Load: Sort image incorrect
    - On Pagination (PPR): Sort image incorrect
    - On Sort Column (i.e. user clicks the column): Sort image is correct. If the user paginates after a custom sort then the sort image is incorrect.

    I was able to do the following workaround. I created it so that it was template independent:

    Add the following JS function in page template:
    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('ddown.gif', 'dup.gif') : $img.attr('src').replace('dup.gif', 'ddown.gif'));
      }
    }//correctStdReportSortImage
    As you can see I'm triggering off the column link's attribute rather than the current image. Given the different scenarios this was the easiest way to check if the image is correct or not.

    Create the following Dynamic Actions in P0

    Event: Page Load

    Action Details
    - Action: JavaScript
    - Code:
    $(this.affectedElements).each(function(){
      correctStdReportSortImage(this);
    });
    - Selection Type: jQuery Selector
    - jQuery Selector: .rpt-sort img


    Event: After Refresh
    - Selection Type: DOM Object
    - DOM Object: document

    Action Details
    - Action: JavaScript
    - Code:
    correctStdReportSortImage($(this.browserEvent.target).find('.rpt-sort img'));
    I created a demo: http://apex.oracle.com/pls/apex/f?p=16406:1300:1 (Note I know that I put an invalid session in the link. There seems to be an issue with session 0 right now)

    Martin
    -----
    http://www.ClariFit.com
    http://www.TalkApex.com
  • 11. Re: Wrong sort order image for classic reports
    Marc Sewtz Pro
    Currently Being Moderated
    Hi Martin,

    Thanks, that appears to be working well, although I do see a split-second icon back-and-forth reversal when I hit F5. But in the end, I get the correct results. Clearly though, that only makes the case for fixing this asap for 4.2. I'll get right on it ;-)

    Thanks again,
    Marc
  • 12. Re: Wrong sort order image for classic reports
    493815 Newbie
    Currently Being Moderated
    Thanks for this workaround. Although I found that this solution didn't work for me initially because my up/down image names were diferrent to the ones specified in the JavaScript. I've rewritten the JS that should work for most to the following:

    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

    Also I found that the dynamic action steps were hard to follow so I wrote a blog about the step-by-step instruction that should work for most which can be viewed here:

    http://technologydribble.info/2012/08/15/oracle-apex-4-1-incorrect-sort-order-image-for-classic-reports/

    Edited by: ariel on Aug 15, 2012 3:48 PM
  • 13. Re: Wrong sort order image for classic reports
    846373 Journeyer
    Currently Being Moderated
    Hi Marc,

    Has this been/Is this going to be finally fixed in APEX 4.2? At least in the APEX 4.2 Early Adopter feature description I can't find any reference to it.

    Thanks,

    Sergio
  • 14. Re: Wrong sort order image for classic reports
    klsharpe Newbie
    Currently Being Moderated
    I have revisited this issue using on apex.oracle.com for v4.2. I created a new classic report using themes 22 and 24 and applied standard & standard alternating report templates.

    The default arrow images are still opposite. The ascending sort selection shows a down arrow, and up arrow for descending sort selection (applied as defaults in the report attributes). My apps had the correct default images before v4.1.0.

    Ironically, in the theme switch wizard, on the Theme compatibility page, the column, Template Type, has the correct up arrow image for ascending sort selection and appears to be a classic report region.

    Will there be a fix for classic report regions?
    Thanks,
    Kelly
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points