Reputation: 82
I have a page object.xhtml which display the list of objects. I want to click on one object and show its details on another page. I don't want to pass parameter via the url or using session's variable.
Upvotes: 2
Views: 9312
Reputation: 362
Assuming you are using a p:datatable
you can create a column to redirect to an edit page:
<p:column headerText="Action">
<p:commandLink ajax="false" title="Edit" action="target.xhtml"
value="Edit">
<f:param name="objectId" value="#{object.id}" />
</p:commandLink>
</p:column>
And in your backing bean you can use the parameter like this:
FacesContext context = FacesContext.getCurrentInstance();
String objectId = context.getExternalContext()
.getRequestParameterMap().get("objectId");
Upvotes: 2