ICEfaces
  1. ICEfaces
  2. ICE-4555

Analyze performance implications of using ViewHandler.writeState call in FormRenderer

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha3
    • Fix Version/s: 2.0-Beta1, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      JSF 2.0

      Description

      Verify if calling ViewHandler.writeState repeatedly in renderers is causing a major slowdown.

        Activity

        Hide
        Mircea Toma added a comment -

        Changed form renderer to write the view state marker expected by com.sun.faces.application.view.WriteBehindStateWriter. WriteBehindStateWriter will call StateManager.getViewState only once and replace all the found markers in the page with the hidden input elements that carry the javax.faces.ViewState value.
        This fix avoids the component tree traversal for calculating state multiple times in case more than on form is found in the view.

        Show
        Mircea Toma added a comment - Changed form renderer to write the view state marker expected by com.sun.faces.application.view.WriteBehindStateWriter. WriteBehindStateWriter will call StateManager.getViewState only once and replace all the found markers in the page with the hidden input elements that carry the javax.faces.ViewState value. This fix avoids the component tree traversal for calculating state multiple times in case more than on form is found in the view.
        Hide
        Ken Fyten added a comment -

        The commit for this change appears to be causing 3 regression test failures:

        ICE-3618 Fails (reset button not working)
        ICE-2614 Fails, application does not load properly, there are no yellow box to drop the dragable red square.
        ICE-2175 Fails, first click on any label does not select its corresponding radio button

        The Glimmer/compat tests for the above are located here: svn/repo/qa/trunk/Regression-Icefaces2/

        Show
        Ken Fyten added a comment - The commit for this change appears to be causing 3 regression test failures: ICE-3618 Fails (reset button not working) ICE-2614 Fails, application does not load properly, there are no yellow box to drop the dragable red square. ICE-2175 Fails, first click on any label does not select its corresponding radio button The Glimmer/compat tests for the above are located here: svn/repo/qa/trunk/Regression-Icefaces2/
        Hide
        Mircea Toma added a comment - - edited

        ICE-2614 test was failing because the dynamic components added to the body and head don't have IDs set. Previous to the ICE-4555 fix the call to StateManager.getViewState made by FormRenderer was forcing an early assignment of IDs (save/restore state is exercised which in turn calls UIComponent.getClientId methods which in turn generates IDs for the components that don't have it assigned yet). Since StateManager.getViewState is not called anymore CoreComponentUtil.findComponentInView was failing with a NullPointerException when using the null ID value of the component.
        Changed findComponentInView and findComponent methods to work with components that don't have the ID set (UIComponent.getId returns null).

        Show
        Mircea Toma added a comment - - edited ICE-2614 test was failing because the dynamic components added to the body and head don't have IDs set. Previous to the ICE-4555 fix the call to StateManager.getViewState made by FormRenderer was forcing an early assignment of IDs (save/restore state is exercised which in turn calls UIComponent.getClientId methods which in turn generates IDs for the components that don't have it assigned yet). Since StateManager.getViewState is not called anymore CoreComponentUtil.findComponentInView was failing with a NullPointerException when using the null ID value of the component. Changed findComponentInView and findComponent methods to work with components that don't have the ID set (UIComponent.getId returns null).
        Hide
        Mircea Toma added a comment -

        Both ICE-3618 and ICE-2175 are failing because the initial fix for this issue generates a 'form' level update on first postback. This is due to input hidden element (holding the view state) inserted only for postbacks.

        As a fix ice:form renderer will write view state marker for any kind of request, postback or page load. This way the DOM diff process won't detect any differences anymore. For page loads the marker is replaced by JSF with the input element using its WriteBackStateWriter Introduce protected method. For poststbacks DOMPartialViewContext.getResponseOutputWriter returns a filter writer that replaces marker with hidden input element.

        Show
        Mircea Toma added a comment - Both ICE-3618 and ICE-2175 are failing because the initial fix for this issue generates a 'form' level update on first postback. This is due to input hidden element (holding the view state) inserted only for postbacks. As a fix ice:form renderer will write view state marker for any kind of request, postback or page load. This way the DOM diff process won't detect any differences anymore. For page loads the marker is replaced by JSF with the input element using its WriteBackStateWriter Introduce protected method. For poststbacks DOMPartialViewContext.getResponseOutputWriter returns a filter writer that replaces marker with hidden input element.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Mircea Toma
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: