Adding the optgroup tag quickly to your xp:combobox

Today I was working on modernizing an xpages application when I came up with a simple enhancement: adding the optgroup tag to a xp:combobox.

By default this option is no available in XPages and if you look around there are some suggestions from hard-coded to DOM modification but I rather looked for a proper JSF implementation.

The data for my combobox resides in a categorized Notes view in a solid NSF so I had two options: navigating through the NotesView via a ViewNavigator (probably next post) or a quick and dirty combo of a dbcolumn and dblookup.

In context with the combobox control the dbcolumn/lookup combo seems suitable 🙂

Here is the simplified setup for my xp:combobox:

As data source I am calling a method on a managed bean. The method is as followed:

The result is nice and straight-forward:

If you questions or difficulties with the implementation, just give me call. Happy development 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s