问题
I am using RichFaces 3.1.6 for an old project with JSF 1.1
Are there any Richfaces themes exists for 3.1.6 version? Because when I add
themes-3.3.3.Final.jar
my application doesn't work, however if I remove the jar from my classpath, then application works fine.
I have the following in JSF page
<rich:dataTable width="100%"
id="dataemp" columnClasses="colClass"
value="#{test.beanValues}" var="emp">
<rich:column>
<f:facet name="header">Employee Number</f:facet>
<h:outputText value="#{emp.employeeNumber}" />
</rich:column>
<rich:column>
<f:facet name="header">Employee Name</f:facet>
<h:outputText value="#{emp.employeeName}" />
</rich:column>
<rich:column>
<f:facet name="header">HireDate</f:facet>
<h:outputText value="#{emp.hireDate}" />
</rich:column>
<rich:column>
<f:facet name="header">Mileage</f:facet>
<h:outputText value="#{emp.deptNo}" />
</rich:column>
</rich:dataTable>
when run the page, I am getting output with no table border or style and web.xml I have
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>DEFAULT</param-value>
</context-param>
Not sure how to add style class with Richfaces,
Screen shot
Update 1
I have managed to resolve style class issue, but still cannot not able to resolve the theme jar issue.
Modified JSF
<rich:dataTable value="#{test.beanValues}"
var="emp" rowClasses="row1, row2" id="empdet" rows="4"
columnClasses="50,100,100,100" onRowMouseOver="this.style.backgroundColor='#B5F3FB'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.rowBackgroundColor}'"
width="350">
<f:facet name="header">
<rich:columnGroup>
<rich:column colspan="4">
<h:outputText value="List of Employees" />
</rich:column>
<rich:column breakBefore="true">
<h:outputText value="Employee #" />
</rich:column>
<rich:column>
<h:outputText value="Employee Name" />
</rich:column>
<rich:column>
<h:outputText value="Hire Date" />
</rich:column>
<rich:column>
<h:outputText value="Dept #" />
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:column>
<f:facet name="header">
<h:outputText value=" "
title="Hack due to bug. Shuold be remoevd till release"></h:outputText>
</f:facet>
<h:outputText value="#{emp.employeeNumber}" />
</rich:column>
<rich:column>
<h:outputText value="#{emp.employeeName}" />
</rich:column>
<rich:column>
<h:outputText value="#{emp.hireDate}" />
</rich:column>
<rich:column>
<h:outputText value="#{emp.deptNo}" />
</rich:column>
</rich:dataTable>
<rich:datascroller align="left" for="empdet"
maxPages="20" />
Screen shot.
回答1:
I don't think 3.3.3.Final.jar will work with Richfaces 3.1.6. In fact, 3.1.6 version is the last RF version that is JSF 1.1 compatible.
However, you can change the skin (or override it to define yours) usingorg.richfaces.SKIN
param that you already used. possible values are found under richfaces-impl-3.1.6.GA/META-INF/skins.
Please refer to this link for skin usage and customization: http://docs.jboss.org/richfaces/latest_4_X/Developer_Guide/en-US/html/chap-Developer_Guide-Skinning_and_theming.html#exam-Developer_Guide-Skinning_and_theming-Using_a_base_skin
Even it's said that it is related to RF4. I think it's applicable to 3.1.6
Hope this is of some help
来源:https://stackoverflow.com/questions/15582791/richfaces-theme-issue-and-datatable-style-class-issue