Using The contentResult Bean
The widget
bean's
contentResult
property only contains data if the
context widget is a Data Source-based widget or a
view invoked by a Data Source-based widget. At present, that means
that the context widget must either be a Teaser widget or a Teaser
View widget.
When present, the contentResult
bean contains
all the content items returned by the widget's Data Source, plus
information about which of the returned items the widget should
render. It has the following properties:
contentResult.resultItems
-
The actual content items returned by the Data Source. You can retrieve them as follows:
- For a Teaser widget:
-
<c:set var="articleList" value="${widget.contentResult.resultItems}"/>
- For a Teaser View widget:
-
<c:set var="articleList" value="${widget.invokingWidget.contentResult.resultItems}"/>
The value returned is a
List<ResultItem>
. contentResult.offset
-
The position in the
contentResult.resultItems
list from which the context widget is to start rendering. contentResult.count
-
The number of content items that the context widget is to render.
contentResult.totalItems
-
The total number of content items in the
contentResult.resultItems
list.