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 で開発しています。