ICEfaces
  1. ICEfaces
  2. ICE-4455

Make inputTextarea render via ResponseWriter

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All

      Description

      Change the h:inputTextarea and ice:inputTextarea component renderers to use the ResponseWriter, and make the pass-through attribute rendering correct.

        Issue Links

          Activity

          Hide
          Mark Collette added a comment -

          Changed the h:inputTextarea and ice:inputTextarea rendering from being DOM based to being ResponseWriter based. This involved refactoring some code from InputTextRenderer into a common class BaseInputRenderer, which InputTextArea could then also make use of. The h: and ice: renderers were modified to make optimal use of the pass-through attribute and effects (ice: only) APIs to improve performance and correctness.

          One issue I ran into was that the old code's applyBrowserDOMChanges() algorith would create an empty child text node in the old DOM for an empty inputTextarea, so the inputTextarea had to render out an empty child text node when there was nothing to render, so the dom diff wouldn't needlessly resend the <textarea>...</textarea> tag. The DOMResponseWriter has code to detect attempt to create empty text nodes, and not do so, which caused the discrepancy for me, resulting in the textarea losing focus. I had to change the component render and the applyBrowserDOMChanges() algorithm to both not create the empty child text node, to fix everything.

          Subversion 18843
          icefaces\component\src\com\icesoft\faces\component\ext\renderkit\TextareaRenderer.java
          icefaces\core\src\com\icesoft\faces\context\BridgeFacesContext.java
          icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java
          icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\InputTextRenderer.java
          icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\PassThruAttributeWriter.java
          icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\TextareaRenderer.java
          icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\BaseInputRenderer.java

          Show
          Mark Collette added a comment - Changed the h:inputTextarea and ice:inputTextarea rendering from being DOM based to being ResponseWriter based. This involved refactoring some code from InputTextRenderer into a common class BaseInputRenderer, which InputTextArea could then also make use of. The h: and ice: renderers were modified to make optimal use of the pass-through attribute and effects (ice: only) APIs to improve performance and correctness. One issue I ran into was that the old code's applyBrowserDOMChanges() algorith would create an empty child text node in the old DOM for an empty inputTextarea, so the inputTextarea had to render out an empty child text node when there was nothing to render, so the dom diff wouldn't needlessly resend the <textarea>...</textarea> tag. The DOMResponseWriter has code to detect attempt to create empty text nodes, and not do so, which caused the discrepancy for me, resulting in the textarea losing focus. I had to change the component render and the applyBrowserDOMChanges() algorithm to both not create the empty child text node, to fix everything. Subversion 18843 icefaces\component\src\com\icesoft\faces\component\ext\renderkit\TextareaRenderer.java icefaces\core\src\com\icesoft\faces\context\BridgeFacesContext.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\InputTextRenderer.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\PassThruAttributeWriter.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\TextareaRenderer.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\BaseInputRenderer.java

            People

            • Assignee:
              Mark Collette
              Reporter:
              Mark Collette
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: