«

»

Xpages Pager Control Tip

I recently added a pager control to an Xpage custom control.  I usually use the default of “Sample 1″ for “Pager style”, but I wanted a last page button, so decided on Sample 4.

Sample 4 should look like this:

|< <Page 1 | 1|2|3|4|5 > >| per the example shown in the control.

But when I added it to my custom control, it kept looking like this:

|< <Page 1 | 1|2|3|4|5 > ..

My application was using the OneUI theming and CSS, so I kept thinking it was getting cut off somehow and I just wasn’t seeing the whole control.  Silly me.

After some poking around, I found “alwaysCalculateLast” in the All Properties tab for the pager control.  Now my pager looks just like the example.  Why the default settings don’t make it look like the example is beyond me, but there ya go.

  • Paul Calhoun

    Careful with that setting.  IBM has stated that the consequences of enabling that property is at the cost of performance based upon the overall size of the view.  That’s why it’s not on by default.

  • http://www.runningnotes.net Kathy Brown

    Good to know.  The “view” (it’s on a repeat control) I’ve currently got it on has about 6,000 docs and no problems with performance (admittedly, it isn’t a very complex view), but definitely a good thing to know.  And at least there is a reason it’s off by default.

  • http://TheSocialNetworker.com IdoNotes

    Strange how a page counter would cause load isnt it

  • James White

    Thanks for the tip! We are in the process of deploying an XPage for a client and I found your blog posting helpful. Unfortunately the client is trying to run the XPage on an 8.5.1 server and it appears that alwaysCalculateLast isn’t supported. Guess it’s time for a server upgrade! :-)