Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 1.7.1
-
Component/s: Framework
-
Labels:None
-
Environment:Facelets
-
Support Case References:
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 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.
-
Hide
- SC_5119.war
- 6.84 MB
- Tyler Johnson
-
- META-INF/MANIFEST.MF 0.0 kB
- WEB-INF/classes/.../TestPhaseListener.class 2 kB
- WEB-INF/classes/log4j.xml 0.5 kB
- WEB-INF/faces-config.xml 0.5 kB
- WEB-INF/lib/backport-util-concurrent.jar 319 kB
- WEB-INF/lib/commons-beanutils.jar 184 kB
- WEB-INF/lib/commons-collections.jar 558 kB
- WEB-INF/lib/commons-digester.jar 140 kB
- WEB-INF/lib/commons-discovery.jar 70 kB
- WEB-INF/lib/commons-el.jar 110 kB
- WEB-INF/lib/commons-fileupload.jar 87 kB
- WEB-INF/lib/commons-lang.jar 240 kB
- WEB-INF/lib/commons-logging-api.jar 44 kB
- WEB-INF/lib/commons-logging.jar 52 kB
- WEB-INF/lib/el-api.jar 24 kB
- WEB-INF/lib/el-ri.jar 97 kB
- WEB-INF/lib/icefaces-comps.jar 1.70 MB
- WEB-INF/lib/icefaces-facelets.jar 593 kB
- WEB-INF/lib/icefaces.jar 958 kB
- WEB-INF/lib/jsf-api.jar 356 kB
- WEB-INF/lib/jsf-impl.jar 778 kB
- WEB-INF/lib/xercesImpl.jar 1.15 MB
- WEB-INF/lib/xml-apis.jar 190 kB
- WEB-INF/web.xml 3 kB
- index.jsp 0.8 kB
- index.xhtml 1.0 kB
- page1.xhtml 0.4 kB
- page2.xhtml 0.4 kB
- secondlevel.xhtml 0.7 kB
- secure/template/.../tabPageTemplate.xhtml 0.6 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
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
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
Confirm fix with success on 1.7.2-SP2 build 3
Tested on Tomcat 6 + FF2 and IE6
Ready for deployment on tomcat 5.5.