I would like to include specific page depending upon button clicked.
As far h:commandButton used,I couldn’t use f:param, so it looks like I should use f:attribute tag.
In case of f:param I would code like this:
<h:commandLink action="connectedFilein">
<f:param name="fileId" value="#{fileRecord.fileId}"/>
<h:commandLink>
<c:if test="#{requestParameters.fileId!=null}">
<ui:include src="fileOut.xhtml" id="searchOutResults"/>
</c:if>
What is the f:attribuite case?
thanks
I assume that you’re using JSF 1.x, otherwise this question didn’t make sense. The
<f:param>in<h:commandButton>is indeed not supported in legacy JSF 1.x, but it is supported since JSF 2.0.The
<f:attribute>can be used in combination withactionListener.with
(Assuming that it’s of
Longtype, which is classic for an ID)Better is however to use the JSF 1.2 introduced
<f:setPropertyActionListener>.Or when you’re already running a Servlet 3.0/EL 2.2 capable container (Tomcat 7, Glassfish 3, etc) and your
web.xmlis declared conform Servlet 3.0, then you could just pass it as method argument.with
Unrelated to the concrete problem, I’d strongly recommend to use JSF/Facelets tags instead of JSTL ones whenever possible.
(A
<h:panelGroup>is also possible and the best approach when using JSP instead of Facelets)