Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
2.3.0
-
None
-
None
-
None
-
TomEE 7.0.3 with MyFaces 2.3.0-SNAPSHOT
Description
While running OmniFaces IT suite on today's MyFaces 2.3.0-SNAPSHOT, I noticed a bug in ResourceHandler#isResourceRendered() during an ajax navigation back to the same view (more specifically, when FacesContext#setViewRoot() is invoked with a new UIViewRoot of same viewId during an ajax postback).
During restore view phase, all already-rendered resources are correctly marked via markResourceRendered(). However, this is in turn stored as a transient UIViewRoot attribute. As a consequence, when the UIViewRoot gets changed during the very same ajax request, they are all lost, causing isResourceRendered() to incorrectly return false.
Basically, the markResourceRendered() of the previous view should be remembered for the next view when PartialViewContext#isAjaxRequest() returns true and isRenderAll() returns false.
In MyFaces 2.2 (and possibly earlier) the behavior of markResourceRendered() and isResourceRendered() was internally correctly implemented via org.apache.myfaces.RENDERED_SCRIPT_RESOURCES_SET context attribute.