I am trying to convert my JSF Application in which all managed beans are session scoped and i am converting them to request scoped and manually maintaining data using unique session ids as request parameters to write and read data from httpsession.
I am using primefaces datatables in my page and on selection of a row i am calling a listener function in my backing bean with p:ajax.
<p:ajax event="rowSelectRadio" listener="#{userB.onUnitSelect}" >
</p:ajax>
I have my sessionID with which i am acccessing my data in a hidden field in the form
<h:inputHidden id="SID" value="#{userB.sessionID}" />
I am trying to pass the above value when the above ajax event is fired. I tried the below two ways and im unable to access my SID value
<p:ajax event="rowSelectRadio" listener="#{userB.onUnitSelect}" >
<f:param name="SID" value="#{userB.sessionID}" />
</p:ajax>
and
<p:ajax event="rowSelectRadio" listener="#{userB.onUnitSelect}" >
<f:setPropertyActionListener target="#{userB.sessionID}" value="1234" />
</p:ajax>
The ajax call is inside the primefaces datatable tags
<p:dataTable></p:dataTable>
sessionID
in a view scoped bean? Or, better, why don't you simply inject the session scoped bean in the request scoped bean? See also stackoverflow.com/q/7031885 – BalusC