我正在尝试突出显示使用 Ricfaces 呈现的表格的当前选定行,但它不起作用。这是我的代码:
小面:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
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"
xmlns:rich="http://richfaces.org/rich" template="templates/main.xhtml">
<ui:define name="body">
<h:form>
<fieldset>
<legend>
<h:outputText value="#{msg['result.legend']}" />
</legend>
<rich:dataTable id="resultTable" onRowMouseOver="this.style.backgroundColor='#f1f1f1'"
onRowMouseOut="this.style.backgroundColor=''"
value="#{searchController.result}" var="row">
<c:forEach items="${searchController.headers}" var="headr"
varStatus="status">
<rich:column>
<f:facet name="header">
<h:outputText value="#{headr}" />
</f:facet>
<h:outputText value="#{row[status.count-1]}" />
</rich:column>
</c:forEach>
</rich:dataTable>
</fieldset>
</h:form>
</ui:define>
我无法粘贴整个模板 (main.xhtml) 源代码。这是 h : body 标签的内容(刚刚发现原因:-)):
<rich:panel styleClass="mainPanel">
<ui:include src="../common/header.xhtml"></ui:include>
<ui:insert name="body"></ui:insert>
</rich:panel>
pom依赖:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>4.2.2.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
</dependency>
<!--dependency> <groupId>javax.faces</groupId> <artifactId>javax.faces-api</artifactId>
</dependency -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.14</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
其中 searchController.headers 是 List< String >,而 searchController.result 是 List< List< String >>。表格本身已正确呈现。
我在这里想念什么?
我正在使用 Richfaces 4.2.2.Final,在 Eclipse Indigo 上开发。