I am trying to generate links with request parameters in a <tr:forEach>
loop. Here's the desired output:
<a href="/forums/ShowForum.jsf?forumId=1">Forum 1</a> <br/>
<a href="/forums/ShowForum.jsf?forumId=2">Forum 2</a> <br/>
<a href="/forums/ShowForum.jsf?forumId=3">Forum 3</a> <br/>
What is the easiest way to do this? I have tried the following:
<h:form>
<div>
<tr:forEach var="forum" items="#{forumListBean.forums}">
<h:outputLink
value="#{facesContext.externalContext.requestContextPath}/ShowForum.jsf"
>
<f:param name="forumId" value="#{forum.id}" />
<h:outputText value="#{forum.title}" />
</h:outputLink>
</tr:forEach>
</div>
</h:form>
This simply produces:
<a href="/forums/ShowForum.jsf?forumId="></a>
Obviously, the forum id and forum title are not substituted.
Naresh