Forum Stats

  • 3,828,007 Users
  • 2,260,847 Discussions
  • 7,897,427 Comments

Discussions

Creating my own pagination scheme

622829
622829 Member Posts: 160
edited Nov 19, 2008 10:16AM in APEX Discussions
I've tried looking through the APEX docs for this, but they don't have much (only how to use the pagination schemes they have). Also tried doing searches on this forum but couldn't find anything either. I've played around with all the various pagination schemes that are offered, but none of them do exactly what I want. I would like my pagination scheme to look like the following:


FIRST PREV 1 2 3 4 5 6 7 8 9 10 NEXT LAST



I want a max of ten numbers in the sequence, so if I click on NEXT, I would like the pagination links to look like:


FIRST PREV 2 3 4 5 6 7 8 9 10 11 NEXT LAST



I think I found the area that I need to look at (the Pagination Subtemplate under Shared Components->Templates), but can't find any documentation on how to make the changes that I need to the "Search Engine 1, 2, 3, 4 (set based pagination)" pagination scheme to make it look how I want. Any suggestions? Tips? Anything? Thanks!
Tagged:

Answers

  • 622829
    622829 Member Posts: 160
    Well, I'm starting to make some headway with understanding these templates (first time I've had to modify one). I do realize that I had copied the settings over from an old template which is why the "Next Set" link wasn't working. I changed the Next Set Template definition from:
    <a href="javascript:html_PPR_Report_Page(this,'#REGION_ID#','#LINK#')" class="t4pagination">#PAGINATION_NEXT_SET#>></a>
    to:
    <a href="#LINK#" class="t4pagination">#PAGINATION_NEXT_SET#>></a>
    This at least got my Next Set and Previous Set links working properly. However, I do not know how to change which elements are shown based on the Pagination Scheme. Is it possible for me to even create my own Pagination Scheme? I'm looking at the Pagination Subtemplate for the template I just created, however, I haven't found any documentation or examples of how to change these settings to get it to do what I want.

    Has anyone done this? Thanks!
  • 618539
    618539 Member Posts: 137
    edited Nov 18, 2008 10:42PM
    I played with this a little. This is not exactly what you are looking for but what I wanted to do was just have the next and previous pagination occur when I clicked an image and I did not want the image in the default locations. So I was able to do this:
    - in the sub template for previous and next I used
     <a href="#LINK# " ID="id for next or prev" > </a>
    * this gives me the ability to retreive the link as a dom element later
    - write a javascript funcion in the header of the page page that simulates a link click
    * this would look something like this
    function clickNext(){
    windows.location = document.getElementById('id of next link').href;
    }
    - I than put an image anywhere I want on the page that calls the javascript
    <a href="javascript:clickNext()"><img src="myImgSrc"/></a>
    Now when you can put the image anywhere and when you click it, it simulates the hidden previous or next pagination buttons.

    Edited by: jfortney on Nov 18, 2008 7:35 PM
  • 622829
    622829 Member Posts: 160
    Cool! Thanks for the tip. I'll try it out.
This discussion has been closed.