@fractastical Paginator VF Page


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <apex:pageBlock id="recordsection" >
  2. <div id="myrecordsection">
  3.  
  4. <apex:pageBlockSection title="All Assigned Tasks" columns="1">
  5.  
  6. <apex:pageBlockTable value="{!activePage.pageTasks}" title="Tasks to Review" var="td" id="ttr">
  7.  
  8. <apex:column headerValue="Name">
  9. <apex:outputField value="{!td.name}"/>
  10. </apex:column>
  11. ...
  12.  
  13. </apex:pageBlockTable>
  14.  
  15. </apex:pageBlockSection>
  16. <apex:outputPanel id="taskPageControls">
  17. <apex:commandLink rendered="{!NOT(activePage.first)}" value="First" rerender="recordsection" action="{!updateActivePage}">
  18. <apex:param name="pnum" value="1" assignto="{!pnum}" />
  19. </apex:commandLink> &nbsp;&nbsp;
  20. <apex:commandLink rendered="{!hasMorePagesBefore}" value="<" rerender="recordsection" action="{!updateActivePagesBackwards}">
  21. <apex:param name="pnum" value="{!activePagesStartPNumber - 1}" assignto="{!pnum}" />
  22. </apex:commandLink> &nbsp;&nbsp;
  23. <apex:commandLink rendered="{!NOT(activePage.first)}" value="Previous" rerender="recordsection" action="{!prevPage}" />
  24. &nbsp;&nbsp;Page:
  25. <apex:repeat value="{!activePages}" var="p">
  26. &nbsp;
  27. <apex:commandLink rendered="{!NOT(p.isActive)}" value="{!p.pagenumber}" rerender="recordsection" action="{!updateActivePage}">
  28. <apex:param name="pnum" id="pnum" value="{!p.pagenumber}" assignto="{!pnum}" />
  29. </apex:commandLink>
  30. <apex:outputText rendered="{!p.isActive}" value="{!p.pagenumber}" />
  31. &nbsp;&nbsp;
  32. </apex:repeat>
  33. <apex:commandLink rendered="{!NOT(activePage.last)}" value="Next" rerender="recordsection" action="{!nextPage}" /> &nbsp;&nbsp;
  34. <apex:commandLink rendered="{!hasMorePagesAfter}" value=">" rerender="recordsection" action="{!updateActivePages}">
  35. <apex:param name="pnum" value="{!activePagesEndPNumber + 1}" assignto="{!pnum}" />
  36. </apex:commandLink> &nbsp;&nbsp;
  37. <apex:commandLink rendered="{!NOT(activePage.last)}" value="Last" action="{!goToLast}" rerender="recordsection" />
  38. <apex:outputpanel id="updateTaskNPPControl" >
  39. &nbsp;Tasks to display per page:&nbsp;
  40. <apex:selectList size="1" value="{!TasksPerPage}" >
  41. <apex:selectOptions value="{!TasksPerPageSO}" />
  42. <apex:actionSupport event="onchange" action="{!updateTasksPerPage}" status="updateTasksStatus" reRender="recordsection" />
  43. </apex:selectList>
  44. </apex:outputpanel>
  45. <BR/>
  46. </apex:outputPanel>
  47. </div> <!-- end myTasks -->
  48. <apex:actionStatus id="updateTasksStatus" onstart="$('#myrecordsection').hide('fast')" onstop="$('#myrecordsection').show();window.scrollTo(0,0);" >
  49. <apex:facet name="start"><apex:image value="{!$Resource.GatheringInfoImage}"/></apex:facet>
  50. </apex:actionStatus>
  51.  
  52. </apex:pageBlock>
  53.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.