Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1549

Skip DataModel iteration when delivering PostRestoreStateEvent

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.2, 2.4.0.M1
    • 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

            Activity

              People

              Assignee:
              pwebb Phil Webb
              Reporter:
              dhs Dennis Hoersch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: