Managing XPages Facets

Home » Managing XPages Facets

Facets are nothing new in XPages. They are the bedrock of what makes XPages so configurable. Drop an Editable Area on a Custom Control and you can place content on that facet when you drop the Custom Control onto an XPage or another Custom Control. As with any other control, they’re not only for use in a Custom Control but also a native XPages control. The places they are most likely to be used are the Application Layout control and the Data View control.

Side note: there are also two facets – header and footer – on any Repeat Control, though they are not exposed in the Design pane for you to drop content onto.

However, remember that facets expect a Container control rather than just, for example, a Computed Field control. This bit me yesterday, when I couldn’t work out why my Computed Field controls weren’t showing in the Category and Summary facets of the Data View. Little while later, after trying various languages and even static text, and I remembered from somewhere in the recesses of my brain that Container controls were required. Suddenly my content showed.

Incidentally, this is a perfect example of when to use the Div control rather than a Panel. The Div control is not exposed in the palette by default. But since 8.5.3 you can customise the palette by right-clicking anywhere in the Controls palette and selecting the relevant option from the menu. The Div control can be selected to show in the palette, along with controls like the Span control.

Another point on facets: remember they can be nested. So say you have a facet on Custom Control A which is placed on Custom Control B, but you want to use Custom Control B on an XPage and define the content for Custom Control A’s facet on the XPage. On Custom Control B, drop another Editable Area control onto the facet of Custom Control A. You can then define your content on the XPage at the top level.

Enjoy.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top