Details
-
Type:
Improvement
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.3.1
-
Component/s: JSF
-
Labels:None
Description
Hi,
after restoring the state, webflow publishes an post restore state event (in JsfViewFactory.getView()) . That one visits the JSF tree. Is it the designated bahavior that the rendered flag of the components is ignored while visting? I asumed that only rendered components will be visited, but I don't know the 'usages' of the post restore state event...
In my project I get an NPE in a component that is not rendered.
The NPE does not occur if I change the publishing code in JSF2FlowApplication from:
JSF2FlowApplication.java
static void publishPostRestoreStateEvent() { FacesContext facesContext = FlowFacesContext.getCurrentInstance(); try { facesContext.getViewRoot().visitTree(VisitContext.createVisitContext(facesContext), new PostRestoreStateEventVisitCallback()); } catch (AbortProcessingException e) { facesContext.getApplication().publishEvent(facesContext, ExceptionQueuedEvent.class, new ExceptionQueuedEventContext(facesContext, e, null, facesContext.getCurrentPhaseId())); } }
to:
JSF2FlowApplication.java
static void publishPostRestoreStateEvent() { FacesContext facesContext = FlowFacesContext.getCurrentInstance(); try { facesContext.getViewRoot().visitTree(VisitContext.createVisitContext(facesContext, null, EnumSet.of(VisitHint.SKIP_UNRENDERED)), new PostRestoreStateEventVisitCallback()); } catch (AbortProcessingException e) { facesContext.getApplication().publishEvent(facesContext, ExceptionQueuedEvent.class, new ExceptionQueuedEventContext(facesContext, e, null, facesContext.getCurrentPhaseId())); } }
Thank you
dennis
Attachments
Issue Links
- relates to
-
SWF-1500 The @ListenerFor annotation for PostRestoreStateEvent doesn't work with Spring Web Flow
-
- Resolved
-