Re: Injection Time

Splash Forums PrettyFaces Users Injection Time Re: Injection Time

#21262

I just tried to reproduce this issue and indeed the dynaview behavior seems to be a bit strange. I’m not an expert for dynaview as I don’t use it often in my applications but I can confirm that there is no injection before view determination.

My current explanation for this is the following:

The parameter validation and injection happens after RESTORE_VIEW. But only if FacesContext.getResponseComplete() is false. If I remember correctly we did this some time ago to fix an incompatibility with PrimeFaces.

The problems seems to be that in case of dynaview we are setting FacesContext.responseComplete() before RESTORE_VIEW after the UIViewRoot has been created. Therefore the injection doesn’t happen.

See:

https://github.com/ocpsoft/prettyfaces/blob/master/core/src/main/java/com/ocpsoft/pretty/faces/event/PrettyPhaseListener.java#L35

I’m not sure regarding all the details why we are setting FacesContext.responseComplete() before RESTORE_VIEW. Lincoln is the expert here! :)

The strange thing also is that in my tests the injection NEVER happens. Not even after the view determination. And the behavior is also reproducible with older PrettyFaces versions like 3.2.0.

@redshadow: You said that the injection and the execution of the viewId method is in the wrong order for you. So you say the injection happens in your project, just too late?