XPages — A Reusable Solution for Computing a Custom Control at Runtime

John Mackey, president, Groupware Solutions Inc.


September, 2009


Take the first steps to building a library of reusable custom controls that your XPages applications can display dynamically at runtime. First, learn how to develop custom controls that developers can pass parameters to. Then, learn the technique for passing a parameter to a computed custom control that will use that parameter to compute which custom control to display at runtime. The complete example code is in a Domino 8.5 database available for download.


In XPages development, you use a custom control when you have a group of fields or functionality that you want to reuse on other XPages within your application. In an earlier article (THE VIEW, 2009) I showed you how to use a custom control that computes which custom control to display on an XPage at runtime, similar to using computed subforms in Domino Designer. Now I’ll show you how to enhance that custom control so you can reuse it in any XPages application to compute any custom control at runtime. Plus, I’ll show you how to create custom control properties for parameters that can be accessed with serverside JavaScript. Learning how to parameterize your custom controls will enable you to build your own library of reusable controls for rapid application development.

Would you like to see the full version of this article?

If you are an electronic license holder to THE VIEW, please log in to view this article.

If you would like information about becoming an electronic license holder — and having 24/7 unrestricted access to all articles and content in THE VIEW Online Knowledgebase — click here to see the available subscription options.

Or call 1-781-751-8813 to speak directly with a subscription and licensing specialist about customized access for you and your team.