tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIScript.java [39:54]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void processEvent(final ComponentSystemEvent event) {
    super.processEvent(event);

    if (event instanceof PreRenderViewEvent) {
      addComponentResource();
    } else if (event instanceof PostAddToViewEvent) {
      if (!getFacesContext().getPartialViewContext().isAjaxRequest()) {
        // MyFaces core is removing the component resources in head if the view will be recreated before rendering.
        // The view will be recreated because of expressions. For example expressions in the ui:include src attribute
        // The PostAddToViewEvent will not be broadcasted in this case again.
        // A subscription to the PreRenderViewEvent avoids this problem
        // Must not subscribe if ajax request, otherwise MyFaces will update the component resources.
        getFacesContext().getViewRoot().subscribeToEvent(PreRenderViewEvent.class, this);
      }
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMeta.java [34:49]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void processEvent(final ComponentSystemEvent event) {
    super.processEvent(event);

    if (event instanceof PreRenderViewEvent) {
      addComponentResource();
    } else if (event instanceof PostAddToViewEvent) {
      if (!getFacesContext().getPartialViewContext().isAjaxRequest()) {
        // MyFaces core is removing the component resources in head if the view will be recreated before rendering.
        // The view will be recreated because of expressions. For example expressions in the ui:include src attribute
        // The PostAddToViewEvent will not be broadcasted in this case again.
        // A subscription to the PreRenderViewEvent avoids this problem
        // Must not subscribe if ajax request, otherwise MyFaces will update the component resources.
        getFacesContext().getViewRoot().subscribeToEvent(PreRenderViewEvent.class, this);
      }
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



