ICEfaces
  1. ICEfaces
  2. ICE-4271

To get the DOMContext after initialization components should call getDOMContext instead of attachDOMContext

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2-RC1, 1.8.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      ICEfaces

      Description

      DOMContext.attach() sometimes creates a malformed subtree that is discarded by DOM error checking. This is the case with the popup menu component. In general the attach() mechanism is inefficient and should be removed. At this time, however, the CommandLinkRenderer makes use of the attach() functionality, possibly through its use of two different root nodes ("a" and "span" depending on whether the component is disabled.

      The recommended fix is to remove the attach() functionality and update the CommandLinkRenderer to a pure ResponseWriter implementation.

        Activity

        Hide
        Adnan Durrani added a comment - - edited

        The following complete list of components is generated using the component-showcase, all of them reach context.attach():

        class --->>>> class com.icesoft.faces.component.outputconnectionstatus.OutputConnectionStatus
        class --->>>> class com.icesoft.faces.component.ext.HtmlSelectOneMenu
        class --->>>> class com.icesoft.faces.component.panelcollapsible.PanelCollapsible
        class --->>>> class com.icesoft.faces.component.panelstack.PanelStack
        class --->>>> class com.icesoft.faces.component.ext.HtmlOutputLabel
        class --->>>> class com.icesoft.faces.component.ext.HtmlSelectManyMenu
        class --->>>> class com.icesoft.faces.component.ext.HtmlSelectOneListbox
        class --->>>> class com.icesoft.faces.component.ext.HtmlSelectManyListbox
        class --->>>> class com.icesoft.faces.component.ext.HtmlMessage
        class --->>>> class com.icesoft.faces.component.ext.HtmlInputSecret
        class --->>>> class com.icesoft.faces.component.selectinputtext.SelectInputText
        class --->>>> class com.icesoft.faces.component.ext.HtmlOutputLabel
        class --->>>> class com.icesoft.faces.component.outputchart.OutputChart
        class --->>>> class com.icesoft.faces.component.outputresource.OutputResource
        class --->>>> class com.icesoft.faces.component.panelseries.PanelSeries
        class --->>>> class com.icesoft.faces.component.gmap.GMap
        class --->>>> class com.icesoft.faces.component.menubar.MenuItem
        class --->>>> class com.icesoft.faces.component.menubar.MenuBar
        class --->>>> class com.icesoft.faces.component.menupopup.MenuPopup
        class --->>>> class com.icesoft.faces.component.menubar.MenuItem
        class --->>>> class com.icesoft.faces.component.menupopup.MenuPopup
        class --->>>> class com.icesoft.faces.component.inputrichtext.InputRichText
        class --->>>> class com.icesoft.faces.component.paneldivider.PanelDivider
        class --->>>> class com.icesoft.faces.component.panelpositioned.PanelPositioned

        Changing "attachDOMContext" to "getDOMContext" trims down the list as follows:

        class --->>>> class com.icesoft.faces.component.ext.HtmlSelectOneMenu
        class --->>>> class com.icesoft.faces.component.ext.HtmlOutputLabel
        class --->>>> class com.icesoft.faces.component.ext.HtmlSelectManyMenu
        class --->>>> class com.icesoft.faces.component.ext.HtmlSelectOneListbox
        class --->>>> class com.icesoft.faces.component.menupopup.MenuPopup
        class --->>>> class com.icesoft.faces.component.ext.HtmlSelectManyListbox
        class --->>>> class com.icesoft.faces.component.panelseries.PanelSeries
        class --->>>> class com.icesoft.faces.component.panelpositioned.PanelPositioned

        Show
        Adnan Durrani added a comment - - edited The following complete list of components is generated using the component-showcase, all of them reach context.attach(): class --->>>> class com.icesoft.faces.component.outputconnectionstatus.OutputConnectionStatus class --->>>> class com.icesoft.faces.component.ext.HtmlSelectOneMenu class --->>>> class com.icesoft.faces.component.panelcollapsible.PanelCollapsible class --->>>> class com.icesoft.faces.component.panelstack.PanelStack class --->>>> class com.icesoft.faces.component.ext.HtmlOutputLabel class --->>>> class com.icesoft.faces.component.ext.HtmlSelectManyMenu class --->>>> class com.icesoft.faces.component.ext.HtmlSelectOneListbox class --->>>> class com.icesoft.faces.component.ext.HtmlSelectManyListbox class --->>>> class com.icesoft.faces.component.ext.HtmlMessage class --->>>> class com.icesoft.faces.component.ext.HtmlInputSecret class --->>>> class com.icesoft.faces.component.selectinputtext.SelectInputText class --->>>> class com.icesoft.faces.component.ext.HtmlOutputLabel class --->>>> class com.icesoft.faces.component.outputchart.OutputChart class --->>>> class com.icesoft.faces.component.outputresource.OutputResource class --->>>> class com.icesoft.faces.component.panelseries.PanelSeries class --->>>> class com.icesoft.faces.component.gmap.GMap class --->>>> class com.icesoft.faces.component.menubar.MenuItem class --->>>> class com.icesoft.faces.component.menubar.MenuBar class --->>>> class com.icesoft.faces.component.menupopup.MenuPopup class --->>>> class com.icesoft.faces.component.menubar.MenuItem class --->>>> class com.icesoft.faces.component.menupopup.MenuPopup class --->>>> class com.icesoft.faces.component.inputrichtext.InputRichText class --->>>> class com.icesoft.faces.component.paneldivider.PanelDivider class --->>>> class com.icesoft.faces.component.panelpositioned.PanelPositioned Changing "attachDOMContext" to "getDOMContext" trims down the list as follows: class --->>>> class com.icesoft.faces.component.ext.HtmlSelectOneMenu class --->>>> class com.icesoft.faces.component.ext.HtmlOutputLabel class --->>>> class com.icesoft.faces.component.ext.HtmlSelectManyMenu class --->>>> class com.icesoft.faces.component.ext.HtmlSelectOneListbox class --->>>> class com.icesoft.faces.component.menupopup.MenuPopup class --->>>> class com.icesoft.faces.component.ext.HtmlSelectManyListbox class --->>>> class com.icesoft.faces.component.panelseries.PanelSeries class --->>>> class com.icesoft.faces.component.panelpositioned.PanelPositioned
        Hide
        Ted Goddard added a comment -

        The problem with attach() is actually the following code, so if components do not reach this, the method can be removed:

        if (rootNode.getParentNode() != cursorParent) {
        try

        { //re-attaching on top of another node //replace them and assume they will re-attach later cursorParent.appendChild(rootNode); }

        catch (DOMException e)

        { //this happens in strea-write mode only. }

        }

        The real problem is the DOMException that is ignored, so for work on this bug, the exception should be printed.

        Show
        Ted Goddard added a comment - The problem with attach() is actually the following code, so if components do not reach this, the method can be removed: if (rootNode.getParentNode() != cursorParent) { try { //re-attaching on top of another node //replace them and assume they will re-attach later cursorParent.appendChild(rootNode); } catch (DOMException e) { //this happens in strea-write mode only. } } The real problem is the DOMException that is ignored, so for work on this bug, the exception should be printed.
        Hide
        Adnan Durrani added a comment -

        There isn't any logger defined for this class, so I just Sysout the exception and removed all my changes. When I tested the component-showcase only menuPopup is throwing this.
        class --->>>> class com.icesoft.faces.component.menupopup.MenuPopup
        org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is no
        t permitted.

        Show
        Adnan Durrani added a comment - There isn't any logger defined for this class, so I just Sysout the exception and removed all my changes. When I tested the component-showcase only menuPopup is throwing this. class --->>>> class com.icesoft.faces.component.menupopup.MenuPopup org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is no t permitted.
        Hide
        Adnan Durrani added a comment -

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\menupopup\MenuPopupRenderer.java
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\panelpositioned\PanelPositionedRenderer.java
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\panelseries\PanelSeriesRenderer.java
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\LabelRenderer.java
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\MenuRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\MenuRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\panelseries\PanelSeriesRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\panelpositioned\PanelPositionedRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\LabelRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\menupopup\MenuPopupRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java
        Completed: At revision: 19064

        Show
        Adnan Durrani added a comment - Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\menupopup\MenuPopupRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\panelpositioned\PanelPositionedRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\panelseries\PanelSeriesRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\LabelRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\MenuRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\MenuRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\panelseries\PanelSeriesRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\panelpositioned\PanelPositionedRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\LabelRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\menupopup\MenuPopupRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java Completed: At revision: 19064
        Hide
        Adnan Durrani added a comment - - edited

        Changes made to the renderers to make sure components are calling getDOMContext to get the DOMContext after initialization and the DOMException being printed.

        I confirmed that the context.attach() never gets hit by any component.

        Show
        Adnan Durrani added a comment - - edited Changes made to the renderers to make sure components are calling getDOMContext to get the DOMContext after initialization and the DOMException being printed. I confirmed that the context.attach() never gets hit by any component.

          People

          • Assignee:
            Adnan Durrani
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: