dynamically creating PanelBar in java.
ranveer.singh Jun 17, 2008 1:46 AMi have created PanelBar and PanelBarItem as given below.
public HtmlPanelBar getMenu(){ menu = new HtmlPanelBar(); HtmlOutputLink link = new HtmlOutputLink(); //HtmlCommandLink link = new HtmlCommandLink(); HtmlPanelBarItem platformAdmin = new HtmlPanelBarItem(); platformAdmin.setLabel("Platform Admin"); platformAdmin.setId("platformAdmin"); platformAdmin.getChildren().add(link); menu.getChildren().add(platformAdmin); HtmlPanelBarItem dataSource = new HtmlPanelBarItem(); dataSource.setLabel("Data Source"); dataSource.setId("dataSource"); menu.getChildren().add(dataSource); HtmlPanelBarItem calender = new HtmlPanelBarItem(); calender.setLabel("Calender Management"); calender.setId("calenderManagement"); menu.getChildren().add(calender); HtmlPanelBarItem timezone = new HtmlPanelBarItem(); timezone.setLabel("Timezone Management"); timezone.setId("timeZoneManagement"); menu.getChildren().add(timezone); HtmlPanelBarItem platformMonitoring = new HtmlPanelBarItem(); platformMonitoring.setLabel("Platform Monitoring"); platformMonitoring.setId("platformMonitoring"); menu.getChildren().add(platformMonitoring); HtmlPanelBarItem contentManager = new HtmlPanelBarItem(); contentManager.setLabel("Content Manager"); contentManager.setId("contentManager"); menu.getChildren().add(contentManager); System.out.println("----------------"+ menu.getChildCount()); return menu; }
In Xhtml :
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <ui:composition> <rich:panel styleClass="panel_menu"> <rich:panelBar selectedPanel="#{componentNavigator.currentComponent.group}" height="600" width="100%" binding="#{componentNavigator.menu}" /> </rich:panel> </ui:composition> </html>
It is creating PanelBar and PanelBarItem but i want to give outputLink inside PanelBarItem as given in richfaces demo.
In other way if i want following format. Then how can i achieve this in java.
<rich:panelBarItem id="platformAdmin" label="Platform Admin" > <ui:include src="/templates/include/components-group.xhtml" > <ui:param name="components" value="#{componentNavigator.platformAdmin}" /> </ui:include> </rich:panelBarItem>
Please help me out.