ICEfaces
  1. ICEfaces
  2. ICE-3439

ice:messages component causing duplicate rendering

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.8DR#2, 1.8
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Facelets

      Description

      Here is a description of the issue based on the attached test case:

      A message is being added to the faces context in a phase listener (TestPhaseListener.java):

      public void beforePhase(PhaseEvent arg0) {
      logger.info("before:" + arg0.getPhaseId());
      if (arg0.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES)) {
      arg0.getFacesContext().addMessage("global",new FacesMessage( FacesMessage.SEVERITY_ERROR, "error", "error"));
      }

      The page contains a panelTabSet that includes a nested tabSet along with ui:composition's. In the inner most ui:composition is where the message is being rendered (TabChangeTemplate.xhtml):

      <ice:panelGroup id="enclosingFormData">
      <ice:panelGroup>
                  <ice:messages id="myMessage1" showDetail="true" showSummary="false"/>
      </ice:panelGroup>
      <ui:insert/>
      </ice:panelGroup>
      </ui:composition>

      However, this configuration causes a duplicate message to be displayed under the panelTabSet. This issue can only be reproduce when clicking for the first time from the first tab to the second tab. All subsequent tab changes do not exhibit this behavior. Attached are screenshots and a test case.

        Activity

        Tyler Johnson created issue -
        Tyler Johnson made changes -
        Field Original Value New Value
        Description A message is being added to the faces context in a phase listener (TestPhaseListener.java):

        public void beforePhase(PhaseEvent arg0) {
        logger.info("before:" + arg0.getPhaseId());
        if (arg0.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES)) {
        arg0.getFacesContext().addMessage("global",new FacesMessage( FacesMessage.SEVERITY_ERROR, "error", "error"));
        }

        The page contains a panelTabSet that includes a nested tabSet along with some tabs including ui:composition's. In the inner most ui:composition is where the message is being rendered (TabChangeTemplate.xhtml):

        <ice:panelGroup id="enclosingFormData">
        <ice:panelGroup>
                    <ice:messages id="myMessage1" showDetail="true" showSummary="false"/>
        </ice:panelGroup>
        <ui:insert/>
        </ice:panelGroup>
        </ui:composition>

        However, this configuration causes a duplicate message to be displayed under the panelTabSet. This issue can also only be reproduce when clicking for the first time from the first tab to the second tab. All subsequent tab changes do not exhibit this behavior. Attached are screenshots and a test case.
        Here is a description of the issue based on the attached test case:

        A message is being added to the faces context in a phase listener (TestPhaseListener.java):

        public void beforePhase(PhaseEvent arg0) {
        logger.info("before:" + arg0.getPhaseId());
        if (arg0.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES)) {
        arg0.getFacesContext().addMessage("global",new FacesMessage( FacesMessage.SEVERITY_ERROR, "error", "error"));
        }

        The page contains a panelTabSet that includes a nested tabSet along with ui:composition's. In the inner most ui:composition is where the message is being rendered (TabChangeTemplate.xhtml):

        <ice:panelGroup id="enclosingFormData">
        <ice:panelGroup>
                    <ice:messages id="myMessage1" showDetail="true" showSummary="false"/>
        </ice:panelGroup>
        <ui:insert/>
        </ice:panelGroup>
        </ui:composition>

        However, this configuration causes a duplicate message to be displayed under the panelTabSet. This issue can only be reproduce when clicking for the first time from the first tab to the second tab. All subsequent tab changes do not exhibit this behavior. Attached are screenshots and a test case.
        Tyler Johnson made changes -
        Tyler Johnson made changes -
        Attachment screenshot-incorrect.jpg [ 11185 ]
        Hide
        Tyler Johnson added a comment -

        Ready for deployment on tomcat 5.5.

        Show
        Tyler Johnson added a comment - Ready for deployment on tomcat 5.5.
        Tyler Johnson made changes -
        Attachment SC_5119.war [ 11186 ]
        Tyler Johnson made changes -
        Environment All Facelets
        Tyler Johnson made changes -
        Summary ice:messages printing duplicates ice:messages component causing duplicate rendering
        Ken Fyten made changes -
        Fix Version/s 1.7.2 [ 10130 ]
        Assignee Priority P3
        Assignee Mark Collette [ mark.collette ]
        Priority Major [ 3 ] Minor [ 4 ]
        Ken Fyten made changes -
        Fix Version/s 1.7.2 [ 10130 ]
        Ken Fyten made changes -
        Fix Version/s 1.8DR#2 [ 10142 ]
        Assignee Priority P3 P1
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18019 Wed Dec 10 16:01:42 MST 2008 mark.collette ICE-3439 : ice:messages component causing duplicate rendering
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/DOMContext.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/MessagesRenderer.java
        Hide
        Mark Collette added a comment -

        There was some negotiation between the FormRenderer and the MessagesRenderer, to allow an HtmlMessages component to render again, after all the other components in the form had rendered. The flag to do so wasn't being cleared properly, resulting in an HtmlMessages from one lifecycle, that had rendered again later, to still be trying to render again in the next lifecycle, even though it shouldn't even be displayed. Since it wasn't being displayed, it had no idea where to properly render, so it was just rendering inside the end of the form element. A second messages component, that should be displayed, was correctly rendering its messages in the correct location. And that is how we were getting duplicate rendered messages.

        Subversion 18019
        icefaces\core\src\com\icesoft\faces\context\DOMContext.java
        icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\MessagesRenderer.java

        Show
        Mark Collette added a comment - There was some negotiation between the FormRenderer and the MessagesRenderer, to allow an HtmlMessages component to render again, after all the other components in the form had rendered. The flag to do so wasn't being cleared properly, resulting in an HtmlMessages from one lifecycle, that had rendered again later, to still be trying to render again in the next lifecycle, even though it shouldn't even be displayed. Since it wasn't being displayed, it had no idea where to properly render, so it was just rendering inside the end of the form element. A second messages component, that should be displayed, was correctly rendering its messages in the correct location. And that is how we were getting duplicate rendered messages. Subversion 18019 icefaces\core\src\com\icesoft\faces\context\DOMContext.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\MessagesRenderer.java
        Mark Collette made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18057 Mon Dec 15 15:45:08 MST 2008 mark.collette ICE-3439 : ice:messages component causing duplicate rendering
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/context/DOMContext.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/MessagesRenderer.java
        Hide
        Mark Collette added a comment -

        Ported the fix to the ICEfaces 1.7 branch.

        Subversion 18057
        icefaces\core\src\com\icesoft\faces\context\DOMContext.java
        icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\MessagesRenderer.java

        Show
        Mark Collette added a comment - Ported the fix to the ICEfaces 1.7 branch. Subversion 18057 icefaces\core\src\com\icesoft\faces\context\DOMContext.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\MessagesRenderer.java
        Ken Fyten made changes -
        Fix Version/s 1.8 [ 10161 ]
        Assignee Priority P1
        Hide
        Joanne Bai added a comment -

        Confirm fix with success on 1.7.2-SP2 build 3

        Tested on Tomcat 6 + FF2 and IE6

        Show
        Joanne Bai added a comment - Confirm fix with success on 1.7.2-SP2 build 3 Tested on Tomcat 6 + FF2 and IE6
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Mark Collette [ mark.collette ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: