Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Page number spacing is compacted in Pega 7.1.6

SA-6905

Summary



Page number spacing disappears when developer apply the filter on their search results Section using Dynamic Select (it has RefreshSection configured OnChange).

Error Messages



Not Applicable

Steps to Reproduce



1. You'll see there is no issue with page number spacing
2. Select any value from Dynamic Select to filter the result (it must have RefreshSection configured OnChange)
3. You'll see that page number spacing will disappear
4. Click on next, page number spacing will be correct again.

Root Cause



It is an issue with out-of-the-box non-auto control pzGridActivePage which is responsible for generating the mark-up for the numbers in the pagination gadget.

Resolution



This issue has been fixed in Pega 7.1.7. Following local-change was suggested to help developer overcome the issue in Pega 7.1.6 -

1. Create a new Section by doing Sav-As of “@baseclass!pyGridPaginator” in Work- class.

2. Create a new control say “customGridActivePage” (as this control will be a fixed version of pzGridActivePage). Following code has to be placed in HTML Source of HTML tab.

 
<pega:choose>
  <pega:when test="param.LinkStyle == ''">
    <pega:save name="LinkStyle" value="" />
  </pega:when>
  <pega:otherwise>
    <% tools.putSaveValue("LinkStyle", "class=\"" + tools.getParamValue("LinkStyle") + "\""); %>
  </pega:otherwise>
</pega:choose>

<pega:choose>
<pega:when test="pxRequestor.pyPegaDesignMode == 'true'">
 <pega:choose>
  <pega:when test="myParamPage.pyPageMode=='Next Previous'">
   <input type="text" disabled size="6"/>
  </pega:when>
  <pega:when test="myParamPage.pyPageMode=='First X Results'">
   <a <p:r n="$save(LinkStyle)" m="literal" /> href="/javascript:void(0)" >First X Results</a>
  </pega:when>
  <pega:when test="myParamPage.pyPageMode=='Drop-Down'">
   <select disabled> </select>
  </pega:when>
  <pega:when test="myParamPage.pyPageMode=='Numeric'">
   <a <p:r n="$save(LinkStyle)" m="literal" /> href="/javascript:void(0)" >1</a> <a href="/javascript:void(0)" >2</a>...
  </pega:when>
 </pega:choose>
</pega:when>
<pega:otherwise>

 
<%int iTotalNoOfPages = Integer.parseInt(tools.getSaveValue("totalPages"));
int iCurrentPage = Integer.parseInt(tools.getSaveValue("currentPageIndex"));
int iStartPage = (iCurrentPage%10==0)?(iCurrentPage-9):((iCurrentPage/10*10)+1);
int iEndPage = (iTotalNoOfPages>(iStartPage+9))?iStartPage+9:iTotalNoOfPages;
%>
<pega:when test="myParamPage.pyPageMode=='Next Previous'">
<input type="text" name="pyGridActivePage" id="pyGridActivePage" onChange="Grids.getActiveGrid(event).gridPaginator(event,this.value)"
onkeypress="if(event.keyCode == 13 ) {   if(!pega.util.Event.isSafari)   { event.cancelBubble = true;if(event.stopPropagation) event.stopPropagation(); }  Grids.getActiveGrid(event).gridPaginator(event,this.value);  }else{ var charCode = (event.which) ? event.which : event.keyCode;     if (charCode > 31 && (charCode < 48 || charCode > 57)) {  if(!pega.util.Event.isSafari)   { event.cancelBubble = true;if(event.stopPropagation) event.stopPropagation(); }         return false;     } }"
value='<pega:getSaved name="currentPageIndex"/>' size="3"
aria-label='<pega:lookup property =".pyCaption" value="Page"/> <pega:getSaved name="currentPageIndex"/> <pega:lookup property =".pyCaption" value="of"/> <%=iTotalNoOfPages%>.'
/>
</pega:when>
  
<pega:when test="myParamPage.pyPageMode=='Drop-Down'">

<%int iTotalRecords = Integer.parseInt(tools.getSaveValue("totalRecords"));%>
<select onChange="Grids.getActiveGrid(event).gridPaginator(event,this.value);" name="pyGridActivePage" id="pyGridActivePage">
 <%for(int i=1; i<=iTotalNoOfPages; i++){
 int iPageRange = Integer.parseInt(tools.getSaveValue("pyPageSize")); 
 int iStartIndex = (i-1)*iPageRange+1;
 int iEndIndex = (i==iTotalNoOfPages)?iTotalRecords:(iStartIndex+iPageRange-1);
 %>
 <option id="<%=i%>" value="<%=i%>" <pega:when java='<%=(i==iCurrentPage)%>'> selected </pega:when>><%=iStartIndex%>-<%=iEndIndex%></option>
 <%}%>
</select>
</pega:when>
<pega:when test="myParamPage.pyPageMode=='Numeric'">
 <%
 for(int i=iStartPage; i<=iEndPage; i++){%>
<pega:when java='<%=(i!=iCurrentPage)%>'><a href="#" onClick="Grids.getActiveGrid(event).gridPaginator(event,'<%=i%>');return false;" aria-label='<pega:lookup property =".pyCaption" value="Page"/> <%=i%>.'><%=i%>   </a></pega:when>
<pega:when java='<%=(i==iCurrentPage)%>'> <a href="#" class="inactiveLink" id="pyGridActivePage" style="font-weight:700;" aria-label='<pega:lookup property =".pyCaption" value="Current Page. Page"/> <%=i%> <pega:lookup property =".pyCaption" value="of"/> <%=iTotalNoOfPages%>.'><%=i%>  </a></pega:when>

<%}%>

</pega:when>

<pega:when test="myParamPage.pyPageMode=='First X Results'">
 <%
  String currentDisplay = tools.getSaveValue("currentDisplay");
  int recordsInCurrentPage = 0;
  try{
  recordsInCurrentPage = Integer.parseInt(tools.getSaveValue("recordsInCurrentPage")); 
  }catch (Exception e){}

 %>
<pega:choose>
<pega:when java='<%=(currentDisplay.equals("First X Results"))%>'><a id="pyGridActivePage" <p:r n="$save(LinkStyle)" m="literal" />  href="#" onClick="Grids.getActiveGrid(event).gridPaginator(event,'Show All');return false;"><%= tools.getLocalizedTextForString("pyButtonLabel", "Show All") %></a></pega:when>
<pega:when java='<%=(currentDisplay.equals("Show All"))%>'><a id="pyGridActivePage" <p:r n="$save(LinkStyle)" m="literal" /> href="#" onClick="Grids.getActiveGrid(event).gridPaginator(event,'First X Results');return false;"><%= tools.getLocalizedTextForString("pyButtonLabel", "First") %> <%= recordsInCurrentPage %> <%= tools.getLocalizedTextForString("pyButtonLabel", "Results")
  %></a> </pega:when>

</pega:choose>

</pega:when>

</pega:otherwise>
</pega:choose>

3. Refer this newly created control “customGridActivePage” in the new Section obtained at Step-1.

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us