tabPanels ok, but no content... why?
airliner Feb 19, 2009 9:50 AMHi everyone!
I'm using RichFaces for the first time and have to code a WebUI with RichFaces.
I tried to use the rich:tabPanel, but there is a pretty huge error:
The tabs got no content! Here are the code parts:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition 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"> <html> <body> <style> .tooltip { background-color:#{richSkin.generalBackgroundColor}; border-width:3px; padding:10px; } .tooltip-text { width:350px; height:80px; cursor:arrow; border-width:2px; text-align:center; display: table-cell; vertical-align: middle; } .tooltipData { font-weight: bold; } </style> <h:form> <a4j:commandButton value="Logout" style="text-align : center; width : 53px;"> <a4j:support disableDefault="true" event="onclick" action="#{UserBean.LogOut}"/> </a4j:commandButton> </h:form> <h:form style="text-align:center;"> <rich:panel> <f:facet name="header"> <h:outputText value="Pumacy Business Intelligence" > </h:outputText> </f:facet> <rich:tabPanel height="100%" width="100%"> <rich:tab label="MyReports"> <ui:include src="MyReports.xhtml"/> </rich:tab> <rich:tab label="MySettings" disabled="true"> <ui:include src="MySettings.xhtml"/> </rich:tab> <rich:tab label="Administration"> <ui:include src="Administration.xhtml"/> </rich:tab> </rich:tabPanel> </rich:panel> </h:form> </body> <h:form> copyright by Pumacy Technologies AG, All rights reserved. </h:form> </html> </ui:composition>
now the content for the two three (one is disabled):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:x="http://java.sun.com/jsp/jstl/xml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:sql="http://java.sun.com/jsp/jstl/sql"> <html> <head> </head> <body> <rich:panel> <rich:dataTable> <rich:column style="weight:80px"> <h:outputText value="reporting status:"/> <a4j:status id="commonstatus" startText="In progress..." stopText="Complete"/> <br /> <rich:spacer height="5" /> <h:form> <a4j:commandButton value="Ok" style="text-align : center; width : 100px;" eventsQueue="foo2"> <a4j:support disableDefault="true" event="onclick" action="reRender"/> </a4j:commandButton> <br/> </h:form> </rich:column> <rich:column> <rich:comboBox selectFirstOnUpdate="false" defaultLabel="select your report"> <f:selectItems value="#{ReportBean.report}" /> </rich:comboBox> </rich:column> </rich:dataTable> <rich:dataTable style=" width : 100%;"> <rich:column style="width:20%;"> <rich:comboBox selectFirstOnUpdate="false" defaultLabel="select your font size"> <f:selectItems value=""/><!-- TODO implement font sizes --> </rich:comboBox> </rich:column> <rich:column style="width:80%;"> </rich:column> </rich:dataTable> <rich:dataTable> <rich:column style="width:20%;"> <h:selectOneListbox id="select" value="#{skinBean.skin}" onchange="submit()"> <f:selectItem itemLabel="plain" itemValue="plain" /> <f:selectItem itemLabel="emeraldTown" itemValue="emeraldTown" /> <f:selectItem itemLabel="blueSky" itemValue="blueSky" /> <f:selectItem itemLabel="wine" itemValue="wine" /> <f:selectItem itemLabel="japanCherry" itemValue="japanCherry" /> <f:selectItem itemLabel="ruby" itemValue="ruby" /> <f:selectItem itemLabel="classic" itemValue="classic" /> <f:selectItem itemLabel="laguna" itemValue="laguna" /> <f:selectItem itemLabel="deepMarine" itemValue="deepMarine" /> </h:selectOneListbox> </rich:column> <rich:column style="width:80%;"> </rich:column> </rich:dataTable> </rich:panel> </body> </html> </ui:composition>
third tab:
<!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" xmlns:x="http://java.sun.com/jsp/jstl/xml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:sql="http://java.sun.com/jsp/jstl/sql"> <h:form> <rich:dataTable> <rich:column> <rich:comboBox selectFirstOnUpdate="false" defaultLabel="select your Datasource"> <f:selectItems value="#{DataSourcesBean.dataSources}" /> </rich:comboBox> <p></p> <rich:comboBox selectFirstOnUpdate="false" defaultLabel="select your reporter config"> <f:selectItems value="#{ReporterConfigBean.reporterconfig}" /> </rich:comboBox> </rich:column> <rich:column> <h:outputText value = "#{DataSourcesBean.dataSources} || #{ReporterConfigBean.reporterconfig}"></h:outputText> </rich:column> </rich:dataTable> </h:form> </html>
Another big problem is that the logout-button don't open the "goodbye.xhtml"...
here the faces-config:
<?xml version="1.0" encoding="UTF-8"?> <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> <managed-bean> <managed-bean-name>UserBean</managed-bean-name> <managed-bean-class>beans.UserBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>SkinBean</managed-bean-name> <managed-bean-class>beans.SkinBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>skin</property-name> <value>emeraldTown</value> </managed-property> </managed-bean> <navigation-rule> <from-view-id>/login.xhtml</from-view-id> <navigation-case> <from-action>#{UserBean.CheckValidUser}</from-action> <from-outcome>success</from-outcome> <to-view-id>/mainpage/reiter.xhtml</to-view-id> </navigation-case> <navigation-case> <from-action>#{UserBean.CheckValidUser}</from-action> <from-outcome>fail</from-outcome> <to-view-id>/mainpage/loginfailed.xhtml</to-view-id> </navigation-case> <navigation-case> <from-action>#{UserBean.LogOut}</from-action> <from-outcome>bye</from-outcome> <to-view-id>/login.xhtml</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>/mainpage/loginfailed.xhtml</from-view-id> <navigation-case> <from-action>#{UserBean.CheckValidUser}</from-action> <from-outcome>success</from-outcome> <to-view-id>/mainpage/reiter.xhtml</to-view-id> </navigation-case> <navigation-case> <from-action>#{UserBean.CheckValidUser}</from-action> <from-outcome>fail</from-outcome> <to-view-id>/mainpage/loginfailed.xhtml</to-view-id> </navigation-case> <navigation-case> <from-action>#{UserBean.LogOut}</from-action> <from-outcome>bye</from-outcome> <to-view-id>/login.xhtml</to-view-id> </navigation-case> </navigation-rule> <application> <!-- Enables Facelets --> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> </faces-config>
and the web.xml
<?xml version="1.0"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>PumBI-UI</display-name> <context-param> <param-name>org.richfaces.SKIN</param-name> <param-value>#{SkinBean.skin}</param-value> </context-param> <context-param> <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> <param-value>com.sun.facelets.FaceletViewHandler</param-value> </context-param> <filter> <display-name>RichFaces Filter</display-name> <filter-name>richfaces</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> </filter> <filter-mapping> <filter-name>richfaces</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <context-param> <param-name>org.richfaces.CONTROL_SKINNING</param-name> <param-value>enable</param-value> </context-param> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</param-value> </context-param> <context-param> <param-name>facelets.REFRESH_PERIOD</param-name> <param-value>2</param-value> </context-param> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>com.sun.faces.verifyObjects</param-name> <param-value>true</param-value> </context-param> <listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> <login-config> <auth-method>BASIC</auth-method> </login-config> </web-app>
I hope you can help me and there is anywhere just a pretty dumb mistake.