ICEfaces
  1. ICEfaces
  2. ICE-10438

Components restored in wrong order when using full state management

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: EE-4.0.0.GA, 4.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces
    • Assignee Priority:
      P2

      Description

      When disabling partial state saving the components are not restored in the correct order. When h:head and h:body are used they are the first ones to be restored by the call to FaceletFullStateManagementStrategy.restoreTree(...). The UIInstructions that would render the markup for the 'html' tags are yet restored at this point because they are marked as transient.
      When ComponentTagHandlerDelegateImpl.apply(...) runs later on the mentioned UIInstructions will be added to the component tree but they will follow the h:head and h:body components. It seems that this method will not rearrange the components that were added by FaceletFullStateManagementStrategy.restoreTree(...) while applying the tags.
      The resulting component tree will look like this:
      UIViewRoot
       * HtmlHead
       * HtmlBody
       * UIInstructions "<html .... >"
       * UIInstructions "</html>"

        Issue Links

          Activity

          Mircea Toma created issue -
          Mircea Toma made changes -
          Field Original Value New Value
          Description When disabling partial state saving the components are not restored in the correct order. When h:head and h:body are used they are the first ones to be restored by the call to FaceletFullStateManagementStrategy.restoreTree(...). The UIInstructions that would render the markup for the 'html' tags are yet restored at this point because they are marked as transient.
          When ComponentTagHandlerDelegateImpl.apply(...) runs later on the mentioned UIInstructions will be added to the component tree but they will follow the h:head and h:body components. It seems that this method will not rearrange the components that were added by FaceletFullStateManagementStrategy.restoreTree(...) while applying the tags.
          The resulting component tree will look like this:
          UIViewRoot
           * HtmlHead
           * HtmlBody
           * UIInstructions "<html .... >"
            * UIInstructions "</html>"
          When disabling partial state saving the components are not restored in the correct order. When h:head and h:body are used they are the first ones to be restored by the call to FaceletFullStateManagementStrategy.restoreTree(...). The UIInstructions that would render the markup for the 'html' tags are yet restored at this point because they are marked as transient.
          When ComponentTagHandlerDelegateImpl.apply(...) runs later on the mentioned UIInstructions will be added to the component tree but they will follow the h:head and h:body components. It seems that this method will not rearrange the components that were added by FaceletFullStateManagementStrategy.restoreTree(...) while applying the tags.
          The resulting component tree will look like this:
          UIViewRoot
           * HtmlHead
           * HtmlBody
           * UIInstructions "<html .... >"
           * UIInstructions "</html>"
          Mircea Toma made changes -
          Assignee Mircea Toma [ mircea.toma ]
          Mircea Toma made changes -
          Fix Version/s 4.1 [ 11375 ]
          Hide
          Mircea Toma added a comment -
          Show
          Mircea Toma added a comment - Original issue: http://jira.icesoft.org/browse/ICE-10214
          Ken Fyten made changes -
          Fix Version/s EE-4.0.0.GA [ 11171 ]
          Fix Version/s 4.1 [ 11375 ]
          Ken Fyten made changes -
          Assignee Priority P2 [ 10011 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #43885 Thu Jan 08 14:27:46 MST 2015 mircea.toma ICE-10438 Trigger creation of 'head' and 'body' facet containers before state management start to track changes in the component tree.
          Files Changed
          Commit graph ADD /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/InitializeHeadAndBodyFacetContainers.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml
          Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/util/CoreUtils.java
          Hide
          Mircea Toma added a comment - - edited

          Trigger creation of 'head' and 'body' facet containers before state management start to track changes in the component tree. This way the 'body' component is re-positioned correctly during tag application (after the view restoring inserts it first in the view root's children).

          Show
          Mircea Toma added a comment - - edited Trigger creation of 'head' and 'body' facet containers before state management start to track changes in the component tree. This way the 'body' component is re-positioned correctly during tag application (after the view restoring inserts it first in the view root's children).
          Mircea Toma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Link This issue blocks ICE-10214 [ ICE-10214 ]
          Hide
          Krashan Brahmanjara added a comment -

          This change broke our application with dynamically (java) created components. Push buttons didn't work correctly and redirect flows to index...

          Show
          Krashan Brahmanjara added a comment - This change broke our application with dynamically (java) created components. Push buttons didn't work correctly and redirect flows to index...
          Hide
          Mircea Toma added a comment - - edited

          Please make a test case that I can use to reproduce what you are seeing.

          Show
          Mircea Toma added a comment - - edited Please make a test case that I can use to reproduce what you are seeing.
          Hide
          Krashan Brahmanjara added a comment -

          I can try but it's not easy in this moment.
          As a workaround we currently use Icefaces from trunk without change 43885. Framework is Icefaces,Myfaces 2.2.7,Primefaces 4, jdk 1.6 & Tomcat 7.0.55

          In short. Pushbuttons dynamically added by belowe code stop works with 43885 change.
          // Context and Expression Factory
          FacesContext fCtx = FacesContext.getCurrentInstance();
          ELContext elCtx = fCtx.getELContext();
          ExpressionFactory ef = fCtx.getApplication().getExpressionFactory();
          ValueExpression ve = ef.createValueExpression(elCtx, "OK", String.class);
          pb.setValueExpression("value", ve);

          MethodExpression mthd = ef.createMethodExpression(elCtx, "#

          {dynamicBeanName.buttonAction('ok')}

          ", void.class, new Class[]

          { String.class }

          );

          pb.setActionExpression(mthd);

          Necessary resources are added as org.icefaces.mandatoryResourceConfiguration equals dataTable tabSet panel pushButton comboBox textEntry dialog dateTimeEntry

          Preferred setting org.icefaces.subtreeDiff=false but it doesn't matter.

          Show
          Krashan Brahmanjara added a comment - I can try but it's not easy in this moment. As a workaround we currently use Icefaces from trunk without change 43885. Framework is Icefaces,Myfaces 2.2.7,Primefaces 4, jdk 1.6 & Tomcat 7.0.55 In short. Pushbuttons dynamically added by belowe code stop works with 43885 change. // Context and Expression Factory FacesContext fCtx = FacesContext.getCurrentInstance(); ELContext elCtx = fCtx.getELContext(); ExpressionFactory ef = fCtx.getApplication().getExpressionFactory(); ValueExpression ve = ef.createValueExpression(elCtx, "OK", String.class); pb.setValueExpression("value", ve); MethodExpression mthd = ef.createMethodExpression(elCtx, "# {dynamicBeanName.buttonAction('ok')} ", void.class, new Class[] { String.class } ); pb.setActionExpression(mthd); Necessary resources are added as org.icefaces.mandatoryResourceConfiguration equals dataTable tabSet panel pushButton comboBox textEntry dialog dateTimeEntry Preferred setting org.icefaces.subtreeDiff=false but it doesn't matter.
          Ken Fyten made changes -
          Fix Version/s 4.1 [ 11375 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: