This discussion is archived
5 Replies Latest reply: Jan 22, 2013 3:58 AM by Nicolette RSS

V4.2.1 Sort function imcompatible with ajax classic rpt

klsharpe Newbie
Currently Being Moderated
Remember Carl Backstrom's wonderful Ajax Region Pull example? [http://apex.oracle.com/pls/otn/f?p=11933:48]

My team liked it so much in the v3.0 days, we used it for our apps to pull results after search criteria was provided. We had issues some point after the PPR features became available. The Search region was page 1 and the resulting report was pulled from page 2. The sort column had an internal function call, $a_report, that assumed the call originated from page 2. It would fail to sort.

So we overloaded $a_report to modify the $x('pFlowStepId').value to the page for the region (...R+pId...). Yes I know that was a no-no since $a_report was internal. Now in v4.2.1, this function is replaced with apex.widget.report.sort = function ( pId, pSortData ).

I think I have time to correct my existing apps and I am looking for a better approach for the same behavior. I still want the user to provide a set of criteria (7 or more items in my apps) before returning results. Screens with no results displayed are needed to avoid waiting for an inefficient query to return a potentially large data set and there is a requirement to show results using scroll bars over pagination.

I don't think an IRR as the pulled region would work in this case.
Thanks,
Kelly

Here is a v4.2.1 example like Carl's:
[http://apex.oracle.com/pls/apex/f?p=13550:3]
user: TESTER
pw: Chk!t
  • 1. Re: V4.2.1 Sort function imcompatible with ajax classic rpt
    klsharpe Newbie
    Currently Being Moderated
    FYI - I tested changing the pulled region into an IRR (its query statement is simpler than my apps) and the function, gReport.controls.widget(this.id), fails also.
    Kelly
  • 2. Re: V4.2.1 Sort function imcompatible with ajax classic rpt
    klsharpe Newbie
    Currently Being Moderated
    I tried to add a dynamic action to see if I could set the page of the pulled region as the current page when a column sort is selected. I get the error that the object, apex.widget.report.sort, is null when the column heading is clicked.

    The DA is on the Click event, condition is a jQuery selector, [id^="COL"], then execute javascript: $s('pFlowStepId','##');

    I have the DA set up as Dynamic and not to execute on page load. I tried setting the Affected Element to Event Source. I am probably attempting something not possible in this DA.

    The object is null error seems as if the jQuery function, widget.report.sort, is not active/visible when pulling the region in from the other page.
  • 3. Re: V4.2.1 Sort function imcompatible with ajax classic rpt
    Nicolette Expert
    Currently Being Moderated
    Kelly

    Instead of pulling the region form a different page.

    Define the region on the same page.
    And use the dynamic actions Show and Refresh.

    Define the items that have the selection criteria to be submitted upon the refresh.

    Use CSS to hide the region on page load. Using the hide dynamic action would cause it to flikker.

    Nicolette
  • 4. Re: V4.2.1 Sort function imcompatible with ajax classic rpt
    klsharpe Newbie
    Currently Being Moderated
    Thanks Nicolette. I was able to move the pulled region to the same page and get it to work with dynamic actions suggested.

    I ended up keeping the region visible (dropping the Show action) to provide a help message in place of the No Data Found response for the region.

    I found I liked using Submit Page for the click of the Go button. It allows the option, Show Processing, to be set to yes, which then puts a GIF up while the long-running query runs and refreshes with the results into the region.
    Kelly
  • 5. Re: V4.2.1 Sort function imcompatible with ajax classic rpt
    Nicolette Expert
    Currently Being Moderated
    Kelly
    klsharpe wrote:
    I found I liked using Submit Page for the click of the Go button. It allows the option, Show Processing, to be set to yes, which then puts a GIF up while the long-running query runs and refreshes with the results into the region.
    I hope you realize that you are now submitting the whole page. Instead of doing a partial page refresh that you where initial doing.
    Using the framework events beforerefresh and afterrefresh you could show the GIF at the start of the refresh. And hide it after the refresh.

    If you set up a simple example on apex.oracle.com showing the GIF you mean. I can point out how to do this using dynamic actions and doing a partial page refresh.

    Nicolette

Legend

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