Menu and content display using Panelmenuitem
aish Feb 18, 2008 5:46 PMHi,
I am new to JSF/richfaces and planning to create a web page. The page should have a menulist at the top of the page and the depending on the menu selection, the content should be displayed in the second half of the page. There is also a small footer section at the bottom of the page.
The menu page is designed as follows -- default-menu.jsp
====
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<rich:panelMenu style="width:200px" mode="ajax"
iconExpandedGroup="disc" iconCollapsedGroup="disc"
iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
iconCollapsedTopGroup="chevronDown"
selectedChild="#{UINavigation.activeItem}"
expandSingle="true">
<rich:panelMenuGroup label="Table Information" expanded="true"
immediate="true" ignoreDupResponses="true" name="tables">
<rich:panelMenuItem label="Summary Table" name="Summary"
action="#{UINavigation.doIQTable}"
reRender="centerGrid">
</rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenu>
====
The doIQTable method in UINavigation bean is given as
public String doIQTable()
{
activeItem="IQTable";
link="/goIQTbl.jsp";
return "IQTable";
}
====
The faces-config.xml is as follows:
<navigation-rule>
<navigation-case>
<from-outcome>IQTable</from-outcome>
<to-view-id>/goIQTbl.jsp</to-view-id>
</navigation-case>
</navigation-rule>
====
The index.jsp page is given as
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
default-menu
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<f:view>
<h:form>
<h:panelGrid columns="1" style="width:800px;height:600px;" border="1">
<h:panelGrid id="headerGrid" columns="1"
style="width:100%;valign:top;" border="1">
<a4j:include viewId="/default-menu.jsp" />
<rich:separator lineType="beveled" height="5" width="100%" />
</h:panelGrid>
<a4j:outputPanel id="teste" ajaxRendered="true">
<h:panelGrid id="centerGrid" columns="1" border="1"
style="width:100%;height:100%;valign:top;">
<a4j:include viewId="#{UINavigation.address}" />
</h:panelGrid>
</a4j:outputPanel>
</h:panelGrid>
<a4j:status id="damnStatus"
onstart="Richfaces.showModalPanel('mp',{width:450, top:200})"
onstop=""></a4j:status>
<a4j:include viewId="/pageFooter.jsp" />
</h:form>
</f:view>
====
The goIQTbl.jsp page is
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<h:outputText value="Displaying the selected details"/>
====
When I deploy this page and select the "Summary" menu item, the goIQTbl.jsp should be displayed in the contents section which is the centerGrid. But the goIQTbl.jsp is displayed in the contents section and also in the section where the default-menu.jsp is displayed overwriting the menus.
Please guide me how I can accomplish to display the selected menu item only in the centerGrid section.
I am using JSF 1.1, Richfaces 3.1.3 and Bea Weblogic92.
Thanks
Aish