Issues using rich:menuItem, reRender & IE7
gs_noe Aug 17, 2009 4:42 PMI am getting some strange behavior in IE7 when trying to use the reRender attribute in a rich:menuItem in a rich:toolbar. When using IE7, the first time the menuItem is selected, the action is fired successfully and the target component (an a4j:outputPanel) re-renders as expected (the element that gets re-rendered inside the outputPanel is an a4j:include that uses the rendered attribute, controlled by a Boolean bean property, so its nothing fancy). Every time the menuItem is selected after that, the action gets fired but the target component does not re-render. I have tried too many things to list and I'm at my wits end :(
I don't have this problem in FF 3.5.2, Opera 9.64 or Chrome 2.0.172.39.
Hopefully I've included all the relevant code below.
Thanks for any help :)
Using JSF 1.2, RichFaces 3.3.1, Tomcat 6.0.20
PageController.java
... public final void testSwitchSubheader() { if (getRenderSubHeader()) { setRenderSubHeader(false); } else { setRenderSubHeader(true); } } ...
base.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"> <head> <title><h:outputText value="#{pageController.pageTitle}"/></title> <link rel="stylesheet" type="text/css" href="css/reset-fonts-grids.css"/> <link rel="stylesheet" type="text/css" href="css/richSinglePanelPage.css"/> <link rel="stylesheet" type="text/css" href="css/master.css"/> </head> <body> <div id="pageContainer"> <div class="yui-t7 rich-page"> <ui:insert name="pageContainer">Page Container</ui:insert> </div> </div> </body> </html>
navbar.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"> <ui:composition> <rich:toolBar styleClass="navbar" id="navBar" style="padding:0;margin:0;" itemSeparator="line" > <rich:dropDownMenu submitMode="ajax"> <f:facet name="label"> <h:panelGroup> <h:outputText value="Testing"/> </h:panelGroup> </f:facet> <rich:menuItem action="#{pageController.testSwitchSubheader}" value="Switch" reRender="subHeaderContainer" limitToList="true"/> </rich:dropDownMenu> </rich:toolBar> </ui:composition> </html>
home.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"> <ui:composition template="/templates/base.xhtml"> <ui:define name="pageContainer"> <h:form id="mainForm"> <a4j:outputPanel id="headerContainer"> <div id="mHd" class="rich-page-header hdrClass"> <a4j:include viewId="#{pageController.pageHeaderUri}" /> </div> </a4j:outputPanel> <a4j:outputPanel id="subHeaderContainer"> <a4j:include viewId="#{pageController.subHeaderUri}" rendered="#{pageController.renderSubHeader}" id="subHeaderInclude"/> </a4j:outputPanel> <a4j:outputPanel id="bodyContainer"> <div id="bd" class="bdyClass"> <ui:include src="#{pageController.pageBodyUri}"/> </div> </a4j:outputPanel> <a4j:outputPanel id="footerContainer"> <div id="ft" class="rich-page-footer ftrClass"> <ui:include src="#{pageController.pageFooterUri}" /> </div> </a4j:outputPanel> </h:form> </ui:define> </ui:composition> </html>
homePageSubHeader.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <ui:composition> <style> .rich-page-subheader { height:299px; background: transparent url("images/headers/mainHeaderChair950x300.jpg") repeat-x 0 0; } </style> <div id="sHd" class="rich-page-subheader sbrClass" > <h:outputText value=""/> </div> </ui:composition> </html>