ICEfaces
  1. ICEfaces
  2. ICE-9922

ace:tree Showcase Compress Dom specific Index out of bounds exception.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P01, 4.0.BETA
    • Fix Version/s: EE-3.3.0.GA_P02, 4.0
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      Tomcat 7, all browsers, Icefaces 4 revision# 40354. Failed before revision #39982.
    • Assignee Priority:
      P1

      Description

      Compress Dom specific issues:
      > Overview, Selection: Expanding plus node beside Canada can become unresponsive and take several clicks to register.
      > Lazy Loading: Cities are unexpectedly loaded with a plus icon, expanding those nodes causes a class.java.lang.IndexOutOfBounds Exception.
      See attached screen shot.
      The city nodes are not supposed to be expandable. Expanding causes the exception.

      To reproduce:
      Build and deploy showcase with this addition to the web.xml file
          <context-param>
              <param-name>org.icefaces.compressDOM</param-name>
              <param-value>true</param-value>
          </context-param>

      Issue 1 - ace:tree >Overview
      Contract selections until Canada is the only remaining selection. Try clicking the plus node, it is unresponsive at times.

      Issue 2 - ace:tree >Lazy Loading
      Expand provincial nodes to reveal cities. Expand a city node, exception will occur. Note there city nodes should not be expandable.

      This is a regression. The exception issue is not present with Icefaces P01, revision # 35307.

        Activity

        Hide
        Ted Goddard added a comment -

        With compressDOM=false, clicking on Lazy Loading Vancouver results in

        decodeExpansion ["0:0:0"]

        whereas with compressDOM=true, the same event generates:

        decodeExpansion ["0:0","0:0:0"]

        Show
        Ted Goddard added a comment - With compressDOM=false, clicking on Lazy Loading Vancouver results in decodeExpansion ["0:0:0"] whereas with compressDOM=true, the same event generates: decodeExpansion ["0:0","0:0:0"]
        Hide
        Ted Goddard added a comment -

        In the compressDOM case, the update from expanding British Columbia does not contain the hidden fields, for example the following is missing:

        <update id="form:tree_expand"><![CDATA[<input autocomplete="off" id="form:tree_expand" name="form:tree_expand" type="hidden" />]]></update>

        Show
        Ted Goddard added a comment - In the compressDOM case, the update from expanding British Columbia does not contain the hidden fields, for example the following is missing: <update id="form:tree_expand"><![CDATA [<input autocomplete="off" id="form:tree_expand" name="form:tree_expand" type="hidden" />] ]></update>
        Hide
        Ted Goddard added a comment -

        In the compressDOM case, the empty value attributes for the hidden fields are simply removed. When the update is applied to the browser DOM, the missing value attribute results in the previous value being retained rather than cleared.

        Show
        Ted Goddard added a comment - In the compressDOM case, the empty value attributes for the hidden fields are simply removed. When the update is applied to the browser DOM, the missing value attribute results in the previous value being retained rather than cleared.
        Hide
        Ted Goddard added a comment -

        This demo also uses subtree rendering. There may be a low-level bug in the interaction between subtree rendering and compressDOM.

        Show
        Ted Goddard added a comment - This demo also uses subtree rendering. There may be a low-level bug in the interaction between subtree rendering and compressDOM.
        Hide
        Ted Goddard added a comment -

        Candidate fix:

        — core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java (revision 40367)
        +++ core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java (working copy)
        @@ -144,6 +144,8 @@

        Document oldDOM = writer.getOldDocument();
        applyBrowserChanges(ec.getRequestParameterValuesMap(), oldDOM);
        + writer.setDocument(oldDOM);
        + writer.saveOldDocument();

        UIViewRoot viewRoot = facesContext.getViewRoot();
        List<DOMUtils.EditOperation> diffs = null;

        Any valid uses for the oldDOM likely require the browser changes, so this change is not expected to introduce regressions. In the compressDOM case it does result in a DOM compression after the browser changes are applied, but this is typically a small CPU cost.

        Show
        Ted Goddard added a comment - Candidate fix: — core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java (revision 40367) +++ core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java (working copy) @@ -144,6 +144,8 @@ Document oldDOM = writer.getOldDocument(); applyBrowserChanges(ec.getRequestParameterValuesMap(), oldDOM); + writer.setDocument(oldDOM); + writer.saveOldDocument(); UIViewRoot viewRoot = facesContext.getViewRoot(); List<DOMUtils.EditOperation> diffs = null; Any valid uses for the oldDOM likely require the browser changes, so this change is not expected to introduce regressions. In the compressDOM case it does result in a DOM compression after the browser changes are applied, but this is typically a small CPU cost.
        Hide
        Ken Fyten added a comment -

        Re-open to backport to the maintenance branch.

        Show
        Ken Fyten added a comment - Re-open to backport to the maintenance branch.
        Hide
        Carmen Cristurean added a comment -

        Verified with ICEfaces-3.3.0-maintenance branch rev# 40479 (compressDOM=true configuration) in FF27, Chrome33, IE10.

        Show
        Carmen Cristurean added a comment - Verified with ICEfaces-3.3.0-maintenance branch rev# 40479 (compressDOM=true configuration) in FF27, Chrome33, IE10.

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Liana Munroe
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: