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

        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.
        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.
        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
        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.
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: