I'm currently trying out sending the id of a record from one page to another page.
So in the page 1, i have something like this :
<p:column>
<h:link value="#{rpb.map['transNum']}" outcome="TInput.xhtml">
<f:param name="id" value="#{rpb.map['id']}" />
</h:link>
</p:column>
and in the target page (TInput.xhtml), i have something like this to capture the id :
....
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<f:metadata>
<f:viewParam name="id" value="#{tInputBean.id}"></f:viewParam>
</f:metadata>
<h:head>
....
Now, clicking on the link, goes to page 2, and page 2 is handled by one view-scoped jsf bean. And from my debugging, this is the order of happenning :
- the @PostConstruct method is executed
- the model is updated with the id captured from the viewParam (after appy request + validation)
What i would like to achieve is that : after the model is updated, i would like to execute a query for that record id, get it's bean and it's list of details from Business Service.
I wonder where should i could put my query code :
- inside @PostConstruct method is not possible, since the id captured from the viewParam is set to the model after the @PostConstruct method finishes
- use a phase listener on after the model update ?
- use a system event ? although i cant seem to find the appropriate one for this case
Please enlighten me :)