Search in sources :

Example 1 with ListPickerComponentInfo

use of uk.nhs.digital.common.components.info.ListPickerComponentInfo in project hippo by NHS-digital-website.

the class ListPickerComponent method doBeforeRender.

@Override
public void doBeforeRender(final HstRequest request, final HstResponse response) {
    final ListPickerComponentInfo paramInfo = getComponentParametersInfo(request);
    final List<HippoDocument> documentItems = getDocumentItems(paramInfo);
    final int pageSize = getPageSize(request, paramInfo);
    final int page = getAnyIntParameter(request, REQUEST_PARAM_PAGE, 1);
    final Pageable<HippoDocument> pageable = getPageableFactory().createPageable(documentItems, page, pageSize);
    request.setModel(REQUEST_ATTR_PAGEABLE, pageable);
    request.setAttribute(REQUEST_ATTR_PARAM_INFO, paramInfo);
}
Also used : HippoDocument(org.hippoecm.hst.content.beans.standard.HippoDocument) ListPickerComponentInfo(uk.nhs.digital.common.components.info.ListPickerComponentInfo)

Aggregations

HippoDocument (org.hippoecm.hst.content.beans.standard.HippoDocument)1 ListPickerComponentInfo (uk.nhs.digital.common.components.info.ListPickerComponentInfo)1