THIS PROBLEM IS ALREADY SOLVED IN THE MYFACES 2.1 IMPLEMENTATION
I have a link which passes an Integer parameter properly like this:
<h:link outcome="/process/createProcess">
<f:param name="id" value="#{process.idprocess}" />
Edit
</h:link>
It goes to "createProcess.xhtml?id=21" properly, and I have this code in the request scope backing Bean createProcess:
@ManagedProperty(value="#{param.id}")
private Integer idProcess;
private Process newProcess;
@PostConstruct
public void init()
{
log();
if (idProcess!=null)
newProcess = Dao.getProcessDAO().get(idProcess);
else
newProcess = new Process();
}
I've notice that idProcess
is always null. After debugging I realized that setIdProcess method is called AFTER @PostConstruct
.
I understand that injection is done just after the construction of the bean and all the managedProperties are available in @PostConstruct
.
What am I missing?