I am using Jsf (2.2.20) and Primefaces (8.0) in my application. In a datatable column I have <h:link> which is passing a column value to another xhtml page.
Code below:
<p:column>
<h:link value="Link1" outcome="testView1.xhtml" style="font-size:8pt;" >
<f:param name="Unique_Key" value="${row.value1}" />
</h:link>
</p:column>
Where row.value1 is the column value.
In testView1.xhtml page I have the below code :
<f:metadata>
<f:viewParam id="unit_id" name="unit_id" value="${Unique_Key}" />
<f:viewAction action="#{testManagedBean.document}" />
</f:metadata>
In testManagedBean class I have a method document() which is having code like :
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
Map<String, String> map = externalContext.getRequestParameterMap();
String param = map.get("unit_id");
But the param is coming always null. Am I doing any wrong in the code?