Why not use simple <h:link>
if all you want is to perform navigation on clicking? And you can set <f:param>
to inform of the tender id or other unique values within the link. As your tender search results are located within <ui:repeat>
, as I suppose, just add simple links to navigate to the tender docs. My point of view is that making a redirect from an action listener method is actually a big problem in design. Usage of command buttons is acceptable if you want to perform some operations on the page or before viewing the target page.
Simple example: part of search.xhtml:
<ui:repeat var="tender" value="#{tenderBean.tenders}">
<!-- UI part of table -->
<h:link value="View tender docs"utcome="path/to/tender/docs/viewDocs.xhtml">
<f:param name="tenderId" value="#{tender.id}" />
</h:link>
</ui:repeat>
Simple example continued: part of viewDocs.xhtml:
<f:metadata>
<f:viewParam name="tenderId" value="#{tenderDocsBean.tenderId}" required="true" />
<f:event type="preRenderView" listener="#{tenderDocsBean.loadTenderDocs}" />
</f:metadata>
Look at this answer on usage of <f:viewParam>
.