ICEfaces
  1. ICEfaces
  2. ICE-6038

Make domDiff work during navigation

    Details

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

      Description

      Currently DOM diffing deosn't work during navigation because the old document is discarded together with the UIViewRoot corresponding to the previous view. To solve the issue the old document needs to be saved somewhere else such as in window scope or request map.

        Activity

        Mircea Toma created issue -
        Mircea Toma made changes -
        Field Original Value New Value
        Assignee Mircea Toma [ mircea.toma ]
        Mircea Toma made changes -
        Salesforce Case []
        Component/s Framework [ 10013 ]
        Fix Version/s 2.0-Beta2 [ 10242 ]
        Hide
        Mircea Toma added a comment -

        Attached patch that changes the saving of old document from UIViewRoot to window scope.

        Show
        Mircea Toma added a comment - Attached patch that changes the saving of old document from UIViewRoot to window scope.
        Mircea Toma made changes -
        Attachment window_scoped_domDiff.patch [ 12551 ]
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P2
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #22397 Wed Sep 22 08:07:49 MDT 2010 mircea.toma ICE-6038 Use window scope to store and restore the old document.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/context/DOMResponseWriter.java
        Hide
        Mircea Toma added a comment -

        Currently the old document is saved as an attribute on the UIViewRoot instance. During navigation the old document is lost because a new UIViewRoot is instantiated.
        To avoid this issue DOMresponseWriter was changed to use window scope to store and restore the old document.

        Using the request map to keep the old document is not possible because on each request (page load or postback) the request map is recreated.

        Show
        Mircea Toma added a comment - Currently the old document is saved as an attribute on the UIViewRoot instance. During navigation the old document is lost because a new UIViewRoot is instantiated. To avoid this issue DOMresponseWriter was changed to use window scope to store and restore the old document. Using the request map to keep the old document is not possible because on each request (page load or postback) the request map is recreated.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ken Fyten added a comment -

        Recent regressions, these passed on Icefaces2 trunk revision# 22392, but fail on Icefaces2 trunk revision# 22397.

        New Failures: ICE-2031 all cannot change selection list by clicking on the new feature button on the test page
        ICE-2399 enter key on Input Secret text field does not trigger Action or actionListener. Also page navigation does not happen.
        ICE-3618 reset button does not clear out all input text fields
        ICE-2150FF pressing enter on popup calendar inputText box opens up the popup calendar.
        ICE-2753IE first drag n drop does not work

        Show
        Ken Fyten added a comment - Recent regressions, these passed on Icefaces2 trunk revision# 22392, but fail on Icefaces2 trunk revision# 22397. New Failures: ICE-2031 all cannot change selection list by clicking on the new feature button on the test page ICE-2399 enter key on Input Secret text field does not trigger Action or actionListener. Also page navigation does not happen. ICE-3618 reset button does not clear out all input text fields ICE-2150 FF pressing enter on popup calendar inputText box opens up the popup calendar. ICE-2753 IE first drag n drop does not work
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #22430 Mon Sep 27 07:55:29 MDT 2010 mircea.toma ICE-6038 Avoid to invoke onServerError listeners when 'malformedXML' error status is received. Stop sending 'head' element updates to not stop the JSF bridge from applying the other updates.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #22431 Mon Sep 27 08:04:08 MDT 2010 mircea.toma ICE-6038 Remove JSFViewStateNavigationFix system listener since oldDOM is not lost during navigation.
        Files Changed
        Commit graph DEL /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/JSFViewStateNavigationFix.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml
        Hide
        Mircea Toma added a comment -

        Due to the use of window scope for saving the oldDOM many times the only 'head' element will be updated instead of the entire document during navigation. When JSF bridge receives an update for the 'head' it will throw an error and stop precessing the rest of the updates. This is what occurs in ICE-2031 and ICE-2399 regressions.
        The solution applied changes the code that serializes the DOM updates to skip sending the 'head' element.

        Show
        Mircea Toma added a comment - Due to the use of window scope for saving the oldDOM many times the only 'head' element will be updated instead of the entire document during navigation. When JSF bridge receives an update for the 'head' it will throw an error and stop precessing the rest of the updates. This is what occurs in ICE-2031 and ICE-2399 regressions. The solution applied changes the code that serializes the DOM updates to skip sending the 'head' element.
        Hide
        Mircea Toma added a comment - - edited

        As a fix for ICE-5728 JSFViewStateNavigationFix inserts the javax.faces.ViewState hidden input element if it detects that during a postback the oldDOM is missing from the UIViewRoot attribute map. Since the oldDOM is stored in the window scope the JSFViewStateNavigationFix system listeners doesn't make sense anymore, oldDOM is not lost during navigation anymore.
        The solution was to simply remove JSFViewStateNavigationFix system listener. This fix fixed the ICE-2753 and ICE-3618 regressions.

        Show
        Mircea Toma added a comment - - edited As a fix for ICE-5728 JSFViewStateNavigationFix inserts the javax.faces.ViewState hidden input element if it detects that during a postback the oldDOM is missing from the UIViewRoot attribute map. Since the oldDOM is stored in the window scope the JSFViewStateNavigationFix system listeners doesn't make sense anymore, oldDOM is not lost during navigation anymore. The solution was to simply remove JSFViewStateNavigationFix system listener. This fix fixed the ICE-2753 and ICE-3618 regressions.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #22491 Fri Oct 01 15:23:22 MDT 2010 ted.goddard using propagated viewMap for OLD_DOM (ICE-6038)
        Files Changed
        Commit graph ADD /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/PropagatingNavigationHandler.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/context/DOMResponseWriter.java
        Commit graph ADD /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/bean
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml
        Commit graph ADD /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/bean/ViewRetained.java
        Hide
        Ted Goddard added a comment -

        Also added @ViewRetained annotation which flags beans in View Scope to be propagated to the new viewMap if the view ID matches on the new view.

        Show
        Ted Goddard added a comment - Also added @ViewRetained annotation which flags beans in View Scope to be propagated to the new viewMap if the view ID matches on the new view.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #22570 Thu Oct 07 15:54:29 MDT 2010 ted.goddard demonstration tests for ViewRetained and WindowDisposed annotations (ICE-6038)
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/samples/test/scopes/src/main/webapp/index.html
        Commit graph ADD /icefaces2/trunk/icefaces/samples/test/scopes/src/main/webapp/view-scope-retained.xhtml
        Commit graph ADD /icefaces2/trunk/icefaces/samples/test/scopes/src/main/java/org/icefaces/demo/scopes/ViewScopedCounterWindowDisposed.java
        Commit graph ADD /icefaces2/trunk/icefaces/samples/test/scopes/src/main/java/org/icefaces/demo/scopes/WindowDisposedCount.java
        Commit graph ADD /icefaces2/trunk/icefaces/samples/test/scopes/src/main/java/org/icefaces/demo/scopes/ViewScopedCounterViewRetained.java
        Commit graph ADD /icefaces2/trunk/icefaces/samples/test/scopes/src/main/webapp/view-scope-disposed.xhtml
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #22755 Thu Oct 21 12:39:22 MDT 2010 ted.goddard added standard ViewScoped counter to retained test (ICE-6038)
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/samples/test/scopes/src/main/webapp/view-scope-retained.xhtml
        Ken Fyten made changes -
        Fix Version/s 2.0.0 [ 10230 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P2

          People

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

            Dates

            • Created:
              Updated:
              Resolved: