Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fractastical/989778 to your computer and use it in GitHub Desktop.
Save fractastical/989778 to your computer and use it in GitHub Desktop.
@fractastical Paginator VF Page
<apex:pageBlock id="recordsection" >
<div id="myrecordsection">
<apex:pageBlockSection title="All Assigned Tasks" columns="1">
<apex:pageBlockTable value="{!activePage.pageTasks}" title="Tasks to Review" var="td" id="ttr">
<apex:column headerValue="Name">
<apex:outputField value="{!td.name}"/>
</apex:column>
...
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:outputPanel id="taskPageControls">
<apex:commandLink rendered="{!NOT(activePage.first)}" value="First" rerender="recordsection" action="{!updateActivePage}">
<apex:param name="pnum" value="1" assignto="{!pnum}" />
</apex:commandLink> &nbsp;&nbsp;
<apex:commandLink rendered="{!hasMorePagesBefore}" value="<" rerender="recordsection" action="{!updateActivePagesBackwards}">
<apex:param name="pnum" value="{!activePagesStartPNumber - 1}" assignto="{!pnum}" />
</apex:commandLink> &nbsp;&nbsp;
<apex:commandLink rendered="{!NOT(activePage.first)}" value="Previous" rerender="recordsection" action="{!prevPage}" />
&nbsp;&nbsp;Page:
<apex:repeat value="{!activePages}" var="p">
&nbsp;
<apex:commandLink rendered="{!NOT(p.isActive)}" value="{!p.pagenumber}" rerender="recordsection" action="{!updateActivePage}">
<apex:param name="pnum" id="pnum" value="{!p.pagenumber}" assignto="{!pnum}" />
</apex:commandLink>
<apex:outputText rendered="{!p.isActive}" value="{!p.pagenumber}" />
&nbsp;&nbsp;
</apex:repeat>
<apex:commandLink rendered="{!NOT(activePage.last)}" value="Next" rerender="recordsection" action="{!nextPage}" /> &nbsp;&nbsp;
<apex:commandLink rendered="{!hasMorePagesAfter}" value=">" rerender="recordsection" action="{!updateActivePages}">
<apex:param name="pnum" value="{!activePagesEndPNumber + 1}" assignto="{!pnum}" />
</apex:commandLink> &nbsp;&nbsp;
<apex:commandLink rendered="{!NOT(activePage.last)}" value="Last" action="{!goToLast}" rerender="recordsection" />
<apex:outputpanel id="updateTaskNPPControl" >
&nbsp;Tasks to display per page:&nbsp;
<apex:selectList size="1" value="{!TasksPerPage}" >
<apex:selectOptions value="{!TasksPerPageSO}" />
<apex:actionSupport event="onchange" action="{!updateTasksPerPage}" status="updateTasksStatus" reRender="recordsection" />
</apex:selectList>
</apex:outputpanel>
<BR/>
</apex:outputPanel>
</div> <!-- end myTasks -->
<apex:actionStatus id="updateTasksStatus" onstart="$('#myrecordsection').hide('fast')" onstop="$('#myrecordsection').show();window.scrollTo(0,0);" >
<apex:facet name="start"><apex:image value="{!$Resource.GatheringInfoImage}"/></apex:facet>
</apex:actionStatus>
</apex:pageBlock>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment