ICEfaces
  1. ICEfaces
  2. ICE-10524

Problem with PartialStateSaving and component binding.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P02, 4.0
    • Fix Version/s: EE-4.0.0.GA, EE-3.3.0.GA_P03, 4.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      jsf 2 icefaces

      Description

      See attached sample app to reproduce. I have tested it with 3.3.0 open source (easier to build as it's maven-built) as well as 3.3.0.GA_P02.
      The sample app basically has a page with 2 links.
          <h:form id="frm">
              <h:commandLink value="Add component to tree"
                             actionListener="#{requestBean.addComponent}"/>
              <br/>
              <h:commandLink value="Trigger lifecycle"
                             actionListener="#{requestBean.doNothing}"/>
              <br/>
              <h:panelGroup id="pgrp" binding="#{requestBean.group}">
              </h:panelGroup>
          </h:form>

      One link will dynamically add an HtmlOutputText component to an HtmlPanelGroup. the other link just triggers a jsf lifecycle.

      If you remove the icefaces jar from the war, with PartialStateSaving set to true (default anyways), then the HtmlPanelGroup state will continue to add another HtmlOutputText when you click on a link. With the icefaces jar, you only ever get the last HtmlOutputText component and if you trigger a new jsf lifecycle, it clears all state of the HtmlPanelGroup.
      The only way to maintain state with the icefaces jar is to set PartialStateSaving to false in web.xml:-
         <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
              <param-value>false</param-value>
      and this is inconsistent with how JSF is behaving.
      Customer has suggested a fix. (see diff attached).

        
         
      1. state_saving.patch
        2 kB
        Judy Guglielmin

        Activity

        Judy Guglielmin created issue -
        Judy Guglielmin made changes -
        Field Original Value New Value
        Assignee Ken Fyten [ ken.fyten ]
        Judy Guglielmin made changes -
        Attachment ice3sbx.war [ 18496 ]
        Judy Guglielmin made changes -
        Attachment state_saving.patch [ 18497 ]
        Attachment state_saving.zip [ 18498 ]
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA_P03 [ 11572 ]
        Ken Fyten made changes -
        Assignee Ken Fyten [ ken.fyten ] Mircea Toma [ mircea.toma ]
        Assignee Priority P1 [ 10010 ]
        Judy Guglielmin made changes -
        Attachment sc13323a.war [ 18580 ]
        Hide
        Mircea Toma added a comment -

        Verified and then applied fix recommended by customer in support case #13323.

        Show
        Mircea Toma added a comment - Verified and then applied fix recommended by customer in support case #13323.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ken Fyten added a comment -

        Re-open to apply this fix for EE 4.0.

        Show
        Ken Fyten added a comment - Re-open to apply this fix for EE 4.0.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Ken Fyten made changes -
        Fix Version/s EE-4.0.0.GA [ 11171 ]
        Ken Fyten made changes -
        Affects Version/s 4.0 [ 11382 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #44261 Wed Mar 18 14:47:07 MDT 2015 mircea.toma ICE-10524 Verified and then applied fix recommended by customer in support case #13323.
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java
        Hide
        Mircea Toma added a comment -

        Applied fix to ICEface4 trunk.

        Show
        Mircea Toma added a comment - Applied fix to ICEface4 trunk.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Judy Guglielmin added a comment -

        both ice3sbx and sc13323a test cases (showing problem with ice:form) fail with latest trunk rev44475
        js error:-
        window] [Fri, 10 Apr 2015 21:21:59 GMT] persisted focus for element "frm:_t6"
        bridge.js.xhtml?ln=ice.core&v=3_3_0_150410:1 [window] [Fri, 10 Apr 2015 21:21:59 GMT] full submit to http://localhost:8080/ice3sbx/main.xhtml
        javax.faces.execute: @all
        javax.faces.render: @all
        javax.faces.source: frm
        view ID: vn62hkq2
        event type: click
        bridge.js.xhtml?ln=ice.core&v=3_3_0_150410:1 Uncaught ReferenceError: source is not defined

        Could not find directions for testing sc13323a so will put them here:-
        In this case it looks like the ICEfaces HtmlForm component is being updated (because the "action" attribute changes when navigating to a new view), and because of this the view state is written to the form in the DOM. This in itself is fine, but to get the viewstate to render to the DOM, the facesContext.getApplication().getStateManager().getViewState(facesContext)); method is called in com.icesoft.faces.context.CompatDOMPartialViewContext$WriteViewStateMarkup, which saves the component tree state and clears the dynamic actions. The subsequent call to get the view state in renderState() in DOMPartialViewContext then saves the state again, but without the dynamic actions.

        If you run the app (sc13323a) and click on the Navigate link, the application navigates to a new view, and in the pre-render event for that view it adds a component to the tree. On the new view, when the Trigger Lifecycle link is clicked, the component that was previously added disappears and is replaced with a new one. The expected behaviour is that no new components are added to the view.

        When the <ice:form> component is replaced with <h:form> the problem disappears. Also making partial state saving to false with ice:form shows correct behavior.
        =========
        anyways, both of these with the latest mtce branch are failing with the above js error (same one).

        Show
        Judy Guglielmin added a comment - both ice3sbx and sc13323a test cases (showing problem with ice:form) fail with latest trunk rev44475 js error:- window] [Fri, 10 Apr 2015 21:21:59 GMT] persisted focus for element "frm:_t6" bridge.js.xhtml?ln=ice.core&v=3_3_0_150410:1 [window] [Fri, 10 Apr 2015 21:21:59 GMT] full submit to http://localhost:8080/ice3sbx/main.xhtml javax.faces.execute: @all javax.faces.render: @all javax.faces.source: frm view ID: vn62hkq2 event type: click bridge.js.xhtml?ln=ice.core&v=3_3_0_150410:1 Uncaught ReferenceError: source is not defined Could not find directions for testing sc13323a so will put them here:- In this case it looks like the ICEfaces HtmlForm component is being updated (because the "action" attribute changes when navigating to a new view), and because of this the view state is written to the form in the DOM. This in itself is fine, but to get the viewstate to render to the DOM, the facesContext.getApplication().getStateManager().getViewState(facesContext)); method is called in com.icesoft.faces.context.CompatDOMPartialViewContext$WriteViewStateMarkup, which saves the component tree state and clears the dynamic actions. The subsequent call to get the view state in renderState() in DOMPartialViewContext then saves the state again, but without the dynamic actions. If you run the app (sc13323a) and click on the Navigate link, the application navigates to a new view, and in the pre-render event for that view it adds a component to the tree. On the new view, when the Trigger Lifecycle link is clicked, the component that was previously added disappears and is replaced with a new one. The expected behaviour is that no new components are added to the view. When the <ice:form> component is replaced with <h:form> the problem disappears. Also making partial state saving to false with ice:form shows correct behavior. ========= anyways, both of these with the latest mtce branch are failing with the above js error (same one).
        Hide
        Judy Guglielmin added a comment -

        see last comment regarding test case failures.

        Show
        Judy Guglielmin added a comment - see last comment regarding test case failures.
        Judy Guglielmin made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Judy Guglielmin made changes -
        Assignee Mircea Toma [ mircea.toma ] Judy Guglielmin [ judy.guglielmin ]
        Hide
        Mircea Toma added a comment - - edited

        Share view state key acquired in DOMPartialViewContext (through the request map) with CompatDOMPartialViewContext.

        Show
        Mircea Toma added a comment - - edited Share view state key acquired in DOMPartialViewContext (through the request map) with CompatDOMPartialViewContext .
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Judy Guglielmin made changes -
        Assignee Judy Guglielmin [ judy.guglielmin ] Ken Fyten [ ken.fyten ]
        Ken Fyten made changes -
        Assignee Ken Fyten [ ken.fyten ] Judy Guglielmin [ judy.guglielmin ]
        Hide
        Ken Fyten added a comment -

        Assigned to Judy to confirm that the EE 4.0 release fix is okay as-is.

        Show
        Ken Fyten added a comment - Assigned to Judy to confirm that the EE 4.0 release fix is okay as-is.
        Hide
        Ken Fyten added a comment -

        Looks like we're seeing a new failure attributable to this recent fix, these are taken from ICE-10053 but are attributable to this JIRA:

        Liana Munroe added a comment - Today 2:40 PM
        Tested with ICEfaces EE-3.3.0 maintenance branch r44497. Tomcat 7, IE 9, 11, FF 34, Chrome 41. The initial issue of the list retracting when using the autoCompleteEntry Only demo with IE 9 appears to be resolved however the demo stops functioning correctly after the first time inputting a character and this is seen in all browsers.
        To reproduce:
        1.) Use autoCompleteEntry Only QA test app or showcase > autoCompleteEntry > Overview on the EE-3.3.0 maintenance branch.
        2.) Type one letter into the autoCompleteEntry and choose a selection from the list.
        3.) Backspace all letters out. The list will display options starting with the initial letter you entered.
        4.) Click away from the autoCompleteEntry to dismiss the list.
        5.) Type one letter into the autoCompleteEntry, the list will no longer display.

        Arturo Zambrano added a comment - Today 3:33 PM - edited
        The last issue seems to be caused by another recent commit in the framework core, under ICE-10524 (r44495). Testing with the latest revision and just reverting the core folder to r44494 doesn't show the issue.

        Show
        Ken Fyten added a comment - Looks like we're seeing a new failure attributable to this recent fix, these are taken from ICE-10053 but are attributable to this JIRA: Liana Munroe added a comment - Today 2:40 PM Tested with ICEfaces EE-3.3.0 maintenance branch r44497. Tomcat 7, IE 9, 11, FF 34, Chrome 41. The initial issue of the list retracting when using the autoCompleteEntry Only demo with IE 9 appears to be resolved however the demo stops functioning correctly after the first time inputting a character and this is seen in all browsers. To reproduce: 1.) Use autoCompleteEntry Only QA test app or showcase > autoCompleteEntry > Overview on the EE-3.3.0 maintenance branch. 2.) Type one letter into the autoCompleteEntry and choose a selection from the list. 3.) Backspace all letters out. The list will display options starting with the initial letter you entered. 4.) Click away from the autoCompleteEntry to dismiss the list. 5.) Type one letter into the autoCompleteEntry, the list will no longer display. Arturo Zambrano added a comment - Today 3:33 PM - edited The last issue seems to be caused by another recent commit in the framework core, under ICE-10524 (r44495). Testing with the latest revision and just reverting the core folder to r44494 doesn't show the issue.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Ken Fyten added a comment -

        Assigned to Mircea to review the regression failure noted in the comment above.

        Show
        Ken Fyten added a comment - Assigned to Mircea to review the regression failure noted in the comment above.
        Ken Fyten made changes -
        Assignee Judy Guglielmin [ judy.guglielmin ] Mircea Toma [ mircea.toma ]
        Hide
        Mircea Toma added a comment - - edited

        Modified DOMPartialViewContext to acquire the view state key after the component tree was visited (rendered) to make sure that the generated key corresponds to the state at the end of JSF lifecycle.

        Show
        Mircea Toma added a comment - - edited Modified DOMPartialViewContext to acquire the view state key after the component tree was visited (rendered) to make sure that the generated key corresponds to the state at the end of JSF lifecycle.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Liana Munroe added a comment -

        Verified autoCompleteEntry issues fixed. ICEfaces 4 trunk, ICEfaces EE-3.3.0 maintenance branch r44504. Tomcat 7, FF 34, Chrome 41, IE 11, 10, 9, 8, 7.

        Show
        Liana Munroe added a comment - Verified autoCompleteEntry issues fixed. ICEfaces 4 trunk, ICEfaces EE-3.3.0 maintenance branch r44504. Tomcat 7, FF 34, Chrome 41, IE 11, 10, 9, 8, 7.
        Ken Fyten made changes -
        Fix Version/s 4.1 [ 11375 ]
        Hide
        Ken Fyten added a comment -

        Note that the final commit to the icefaces4/trunk for this issue does not affect the functionality in the EE 4.0 release, which was based on the implementation prior to this commit. However, this final commit will be included in future IF 4 releases (4.1+).

        Show
        Ken Fyten added a comment - Note that the final commit to the icefaces4/trunk for this issue does not affect the functionality in the EE 4.0 release, which was based on the implementation prior to this commit. However, this final commit will be included in future IF 4 releases (4.1+).
        Hide
        Carmen Cristurean added a comment -

        Verified on ICEfaces4 trunk r.44504 (test case "ice3sbx"), and ICEfaces 3.3.0 r.44504 (test cases "ice3sbx" and "sc13323a"), in IE11, Chrome41, FF34.

        Regression tests added to the QA framework:

        Show
        Carmen Cristurean added a comment - Verified on ICEfaces4 trunk r.44504 (test case "ice3sbx"), and ICEfaces 3.3.0 r.44504 (test cases "ice3sbx" and "sc13323a"), in IE11, Chrome41, FF34. Regression tests added to the QA framework: for IF4 trunk testing: http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Manual/ICE-10524 for IF-3.3.0 testing: http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Manual/ICE-10524 http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Manual/ICE-10524a
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: