Have a look at the Extension Library, either in Upgrade Pack 1 (requires 8.5.3) or the project on OpenNTF (8.5.2 versions are available as well as version more recent than UP1 for 8.5.3). There is a control for that.
I would strongly recommend the XPages Extension Library book. Even though I wrote several chapters including those on views, I still find it invaluable as a reference source. There is too much in the Extension Library to remember it all once you know it. And it certainly helps get you up to speed if you don't know it.