ICEfaces
  1. ICEfaces
  2. ICE-5231

Fully support the render attribute of f:ajax tag

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha1
    • Fix Version/s: 2.0-Alpha3, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 2.0 JSF 2.0
    • Workaround Exists:
      Yes
    • Workaround Description:
      Specify @all and let ICEfaces determine what needs to be executed/rendered

      Description

      The f:ajax tag allows attributes to determine which portions of a page should be executed and which should be rendered. ICEfaces should support the full range of both of these attributes. Since the attributes meaningfully apply to different parts of the JSF lifecycle (execute vs render), there are separate JIRAs for each part. This case applies to the render part of the lifecycle.

        Issue Links

          Activity

          Deryk Sinotte created issue -
          Deryk Sinotte made changes -
          Field Original Value New Value
          Link This issue is duplicated by ICE-4949 [ ICE-4949 ]
          Deryk Sinotte made changes -
          Salesforce Case []
          Fix Version/s 2.0-Beta [ 10032 ]
          Assignee Deryk Sinotte [ deryk.sinotte ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #21030 Mon Mar 22 11:41:49 MDT 2010 ted.goddard identifying id attribute for use by getElementById (ICE-5231)
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMResponseWriter.java
          Ted Goddard made changes -
          Assignee Deryk Sinotte [ deryk.sinotte ] Ted Goddard [ ted.goddard ]
          Hide
          Ted Goddard added a comment -

          document.getElementById() looks reasonable to add to DOMResponseWriter, so I will prototype the JSF rendering aspect. This bug is slightly higher in priority now since many of the mojarra tests exercise this feature.

          Show
          Ted Goddard added a comment - document.getElementById() looks reasonable to add to DOMResponseWriter, so I will prototype the JSF rendering aspect. This bug is slightly higher in priority now since many of the mojarra tests exercise this feature.
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #21042 Mon Mar 22 17:22:17 MDT 2010 ted.goddard initial but fragile subtree rendering (ICE-5231)
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMResponseWriter.java
          Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMPartialViewContext.java
          Hide
          Ted Goddard added a comment -

          An initial prototype for subtree rendering has been checked in.

          Support for document.getElementById() is provided by identifying the id attribute via

          Element.setIdAttributeNode()

          for attributes that are named "id".

          During partial rendering (isRenderAll() == false) the list of ids is "visited" with an encodeAll() in tree visitor callback. The first complication is that the new DOM is empty (the page has not been rendered yet). This is resolved by cloning the old DOM. When a component is partially rendered, the previous subtree is replaced with an empty version; the problem with this, is that the first action of the component is to render the root of the subtree. To suppress this, a flag is set that suppresses the next startElement().

          To improve this implementation, the old DOM should not be cloned: it would be more efficient to keep the subtree fragments generated by the rendered components. As a feature improvement, it should be possible to specify whether a given subtree will have the DOM diff applied or not.

          Show
          Ted Goddard added a comment - An initial prototype for subtree rendering has been checked in. Support for document.getElementById() is provided by identifying the id attribute via Element.setIdAttributeNode() for attributes that are named "id". During partial rendering (isRenderAll() == false) the list of ids is "visited" with an encodeAll() in tree visitor callback. The first complication is that the new DOM is empty (the page has not been rendered yet). This is resolved by cloning the old DOM. When a component is partially rendered, the previous subtree is replaced with an empty version; the problem with this, is that the first action of the component is to render the root of the subtree. To suppress this, a flag is set that suppresses the next startElement(). To improve this implementation, the old DOM should not be cloned: it would be more efficient to keep the subtree fragments generated by the rendered components. As a feature improvement, it should be possible to specify whether a given subtree will have the DOM diff applied or not.
          Hide
          Ted Goddard added a comment -

          Implementation note: it is not necessary to clone the DOM. When partial rendering is used, the replaced fragments of the old DOM can be retained. Modification of the old DOM in-place can be used to create the new DOM. The diff can then be run against the retained fragments.

          Show
          Ted Goddard added a comment - Implementation note: it is not necessary to clone the DOM. When partial rendering is used, the replaced fragments of the old DOM can be retained. Modification of the old DOM in-place can be used to create the new DOM. The diff can then be run against the retained fragments.
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #21088 Fri Mar 26 09:43:54 MDT 2010 ted.goddard corrected log message string (ICE-5231)
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMResponseWriter.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #21117 Wed Mar 31 11:38:24 MDT 2010 ted.goddard diff applied just to rendered subtrees (ICE-5231)
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/util/DOMUtils.java
          Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMResponseWriter.java
          Commit graph MODIFY /icefaces/scratchpads/glimmer/samples/basic/src/main/webapp/icefaces.xhtml
          Commit graph MODIFY /icefaces/scratchpads/glimmer/samples/basic/src/main/java/org/icefaces/demo/basic/Basic.java
          Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMPartialViewContext.java
          Commit graph ADD /icefaces/scratchpads/glimmer/samples/basic/src/main/webapp/icefaces-subtree.xhtml
          Hide
          Ted Goddard added a comment -

          The diff is now being applied to just the rendered subtrees:

          If isRenderAll() is false, the DOMResponseWriter is flagged for subtree rendering, and uses the old DOM as the current DOM
          For each component subtree render, the existing DOM subtree is removed and the new subtree is rendered in its place
          The diff is calculated against the recently removed subtree

          The assumption is that a given component will render a rooted subtree of markup. Component rendering behavior other than this (such as rendering two elements, or rendering a new element without an ID) would result in an empty or malformed diff result.

          The basic sample has been enhanced to include icefaces-subtree.jsf (with both execute and render directives). The ICEfaces pages now also include a timestamp to show which part of the page is updated. For icefaces.jsf, the timestamp is always updated because the full page is rendered. For icefaces-subtree.jsf, the timestamp is not updated because it is not included in the render directive.

          Show
          Ted Goddard added a comment - The diff is now being applied to just the rendered subtrees: If isRenderAll() is false, the DOMResponseWriter is flagged for subtree rendering, and uses the old DOM as the current DOM For each component subtree render, the existing DOM subtree is removed and the new subtree is rendered in its place The diff is calculated against the recently removed subtree The assumption is that a given component will render a rooted subtree of markup. Component rendering behavior other than this (such as rendering two elements, or rendering a new element without an ID) would result in an empty or malformed diff result. The basic sample has been enhanced to include icefaces-subtree.jsf (with both execute and render directives). The ICEfaces pages now also include a timestamp to show which part of the page is updated. For icefaces.jsf, the timestamp is always updated because the full page is rendered. For icefaces-subtree.jsf, the timestamp is not updated because it is not included in the render directive.
          Hide
          Ted Goddard added a comment -

          This feature is now implemented.

          Testing of pathological cases would be useful (such as render directives for non-existant or overlapping IDs), however, we must compare the ICEfaces failure in these cases to the stock JSF failure).

          It is recommended that developers use <f:ajax> render directives only as a last resort for performance optimization, as stale render directives will result in pages that are extremely difficult to maintain.

          Show
          Ted Goddard added a comment - This feature is now implemented. Testing of pathological cases would be useful (such as render directives for non-existant or overlapping IDs), however, we must compare the ICEfaces failure in these cases to the stock JSF failure). It is recommended that developers use <f:ajax> render directives only as a last resort for performance optimization, as stale render directives will result in pages that are extremely difficult to maintain.
          Ted Goddard made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Salesforce Case []
          Ken Fyten made changes -
          Fix Version/s 2.0.0 [ 10230 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Ted Goddard
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: