Implementing a list widget for a predefined query


How can I create a widget like the vocabulary widget (a user can select an item from a vocabulary list) but instead of the vocabulary list I want to have a list with items from a query. (i.e. I want the list to show all titles of documents belonging to a specific schema and be able to select one of them and set it as a property on another document on the creation page of that document).

Is there any documentation on this subject?

Thank you

0 votes

1 answers




There is an existing widget type called “multipleDocumentsSuggestion” (you can see its contribution here:–widgettypes) that can match your need, although it only handles lists of documents (no single selection). The page provider on this widget type can be configured, so that you can set your specific logic (e.g search among documents holding a given schema). The documentation for page providers is available at

If you'd like to have a simple selection instead of a suggestion, you can define a custom widget template (see the doc at, using the nxu:selectItems tags will probably make your life easier ( You'll have to bind it to a seam component that will perform the query directly, or use a page provider to get the list of documents if you'd like the filtering to be configurable on the widget so that it's more generic and can be reused in different use cases (and you would also be able to reuse its other features, like handling the maximum number of results to avoid overloading the server if there are too many matching documents).

Note also that this kind of “rich” widget types is part of improvements we'd like to make on the platform so that it's available by default, and is easier to use and configure.

2 votes