Forum Stats

  • 3,853,698 Users
  • 2,264,256 Discussions
  • 7,905,434 Comments

Discussions

How can I decouple the pagination for a global region?

Howard (... in Training)
Howard (... in Training) Member Posts: 905
edited Sep 2, 2013 12:17AM in APEX Discussions

I was having a delightful time using a common region defined on a global page when I determined that pagination setting was begin carried from one page to the next.  Arghhhh!  So for example, if I have paged to the second set (page) of rows (11-20) on Page 1 and then I go to Page 2, the second set (page) of rows (11-20) is displayed there.   If I go to a page which only has a first set of rows (1-10), I get the pagination error "Invalid set of rows requested, the source data of the report has been modified. Reset Pagination".  And when I click to reset, it just repeats the error.  [I suppose it tries to display the second set or rows (11-20) again -- which doesn't exist.  What's that saying about insanity?]  

How can I decouple the pagination for a global region? I want it to operarate just as it would if it were not sharing a common region.  So if I'm looking at rows (11-20) on page 1, I can go to any other page beginning with rows 1-10 there.  Then return to page 1 where I left off with rows 11-20 displayed.  One solution is NOT to paginate but that's not my preferred solution.

Howard

Tagged:

Best Answer

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,217 Red Diamond
    Answer ✓
    Howard(...inTraining) wrote:
    
    My task, as assigned, is to replace the output in an EXCEL spreadsheet.  If I closely followed the L&F of the spreadsheet, I'd have all the rows displayed and this problem would go away.  But alas, I'm trying to make it look "nice" by paginating.  No, it's not an APEX "report".  
    

    Columns...rows...pagination...sure sounds like a duck report.

    [Let me switch from the original question to the issue you raised.]  It's the Global Page formatting that I'd like to keep reusable.   There are eight (8) identically formatted pages.
    

    So is one generic page not possible? What requires there to be eight?

    Maybe 10 columns to display and 4 to 175 data rows.  The data display is dense and I've been working, for literally months, to get a similar format.  (Which is the reason for all the formatting questions I've been asking.)   Some columns link to edit pages.   I went to a Global Page so that changes could be made in one place and be reflected in all 8 pages.   If I need to change a column width, I don't want to do that 8 times.  Nor have to check 8 different pages to make sure I have them all identical.
    
    Any techniques for reusable formatting?

    Templates, CSS, substitution strings, and the aforementioned reusable SQL.

    Suggest you come up with a concrete example on apex.oracle.com and see what we can come up with.

Answers

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,217 Red Diamond
    Howard(...inTraining) wrote:
    
    I was having a delightful time using a common region defined on a global page when I determined that pagination setting was begin carried from one page to the next.  Arghhhh!  So for example, if I have paged to the second set (page) of rows (11-20) on Page 1 and then I go to Page 2, the second set (page) of rows (11-20) is displayed there.   If I go to a page which only has a first set of rows (1-10), I get the pagination error "Invalid set of rows requested, the source data of the report has been modified. Reset Pagination".
    

    The fact that there are different numbers of rows returned on different pages implies that the reports have some local page dependencies, so why try to use a global component? What's the actual requirement? How many pages does the report have to appear on? (Please say it is a report and not a tabular form...)

    How can I decouple the pagination for a global region?  I want it to operarate just as it would if it were not sharing a common region.
    

    The point is that a global region is just that: a single region that happens to be displayed on multiple pages. It does not create multiple instances of a region on different pages. (Specifically, a region has a single region ID, and this is used to reference it whether it appears on one page or all of them. The region ID is used by the report for the purposes of AJAX refresh, pagination etc.)

    A similar situation was discussed a long time ago. I'm rather surprised that Scott regarded it as a bug: the fact that it doesn't seem to have been "fixed" or have a bug number attached may indicate that the others on the APEX team disagreed with him? I haven't tried the workaround he suggested, however I don't think it's likely to be prove a useful line of attack for your issue, as (1) it resets pagination rather than preserving it; and (2) it doesn't appear to be compatible with the AJAX PPR pagination used in more recent versions of APEX.

    I can't see any straightforward "solution" (largely because I don't think there's really a problem: the exhibited behaviour is exactly how I expect/want global regions to behave). Pagination processing is undocumented. The current 4.2 apex.widget.report.paginate JS method is specifically annotated as "for internal use only". Search the forum for custom pagination techniques. Messy looking hacks for IRs have previously been suggested.

    So if I'm looking at rows (11-20) on page 1, I can go to any other page beginning with rows 1-10 there.  Then return to page 1 where I left off with rows 11-20 displayed.  One solution is NOT to paginate but that's not my preferred solution.
    

    Assuming that there aren't too many pages involved, the other obvious option is to create unique regions on the required pages. You can achieve some level of reusability by creating SQL Query (PL/SQL function body returning SQL query) reports based on an external function so that there's only a single SQL source to be maintained.

    Explain the requirement in more detail. Pagination is not the only option for reducing the quantity of displayed information. Often it's better to display some of all of the data, rather than all of some of it...

  • Howard (... in Training)
    Howard (... in Training) Member Posts: 905
    edited Sep 1, 2013 7:04PM

    Thanks Paul,


    My task, as assigned, is to replace the output in an EXCEL spreadsheet.  If I closely followed the L&F of the spreadsheet, I'd have all the rows displayed and this problem would go away.  But alas, I'm trying to make it look "nice" by paginating.  No, it's not an APEX "report".  I was thinking in the broad since of the existing application and not the specific APEX vernacular.

    Yes, I think I can make the query reusable several ways.  I thought about putting it in an Application Item, if possible.


    [Let me switch from the original question to the issue you raised.]  It's the Global Page formatting that I'd like to keep reusable.   There are eight (8) identically formatted pages.  Maybe 10 columns to display and 4 to 175 data rows.  The data display is dense and I've been working, for literally months, to get a similar format.  (Which is the reason for all the formatting questions I've been asking.)   Some columns link to edit pages.   I went to a Global Page so that changes could be made in one place and be reflected in all 8 pages.   If I need to change a column width, I don't want to do that 8 times.  Nor have to check 8 different pages to make sure I have them all identical.


    Any techniques for reusable formatting?


    Thanks,

    Howard

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,217 Red Diamond
    Answer ✓
    Howard(...inTraining) wrote:
    
    My task, as assigned, is to replace the output in an EXCEL spreadsheet.  If I closely followed the L&F of the spreadsheet, I'd have all the rows displayed and this problem would go away.  But alas, I'm trying to make it look "nice" by paginating.  No, it's not an APEX "report".  
    

    Columns...rows...pagination...sure sounds like a duck report.

    [Let me switch from the original question to the issue you raised.]  It's the Global Page formatting that I'd like to keep reusable.   There are eight (8) identically formatted pages.
    

    So is one generic page not possible? What requires there to be eight?

    Maybe 10 columns to display and 4 to 175 data rows.  The data display is dense and I've been working, for literally months, to get a similar format.  (Which is the reason for all the formatting questions I've been asking.)   Some columns link to edit pages.   I went to a Global Page so that changes could be made in one place and be reflected in all 8 pages.   If I need to change a column width, I don't want to do that 8 times.  Nor have to check 8 different pages to make sure I have them all identical.
    
    Any techniques for reusable formatting?

    Templates, CSS, substitution strings, and the aforementioned reusable SQL.

    Suggest you come up with a concrete example on apex.oracle.com and see what we can come up with.

  • This version is from three weeks ago.  I'll have to mock up some data for it. 

    APEX_EXAMPLES_01

    demo/demo

    Application 44997 - BPS_f1201

    Thanks,

    Howard

This discussion has been closed.