Ricfaces를 사용하여 렌더링 된 테이블의 현재 선택된 행을 강조 표시하려고했지만 작동하지 않습니다. 여기에 내 코드입니다 :Richfaces Javascript가 실행되지 않음
facelet :
<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) 소스 코드를 붙여 넣기를 보내고 있습니다. 이것은 시간의 내용이다 : (단지 왜 :-) 발견) body 태그 :
<rich:panel styleClass="mainPanel">
<ui:include src="../common/header.xhtml"></ui:include>
<ui:insert name="body"></ui:insert>
</rich:panel>
치어 종속성 :
searchController.headers이 목록 < 문자열입니다<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.result 목록입니다 < 목록 < 문자열 >>. 테이블 자체가 올바르게 렌더링됩니다.
무엇이 여기에 있습니까?
나는 Richands 4.2.2.Final을 사용하여 Eclipse Indigo에서 개발 중입니다.
가능한 중복 http://stackoverflow.com/q/10129551/1065197 –
나는 그 스레드에서 제안 된대로 onRowMouseOver를 구현하려고합니다. 나는 내가 여기 발견 한 예제에 대한 나의 시도를 근거로 삼고있다 : http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf,하지만 내가 한 것은 작동하지 않는다. 나는 이것이 복제본이라고 생각하지 않는다. – JazzHands
개념이 잘못되었습니다. onRowMouseOver와 onRowMouseOut는'this'를 사용하여'rich : dataTable' 배경색을 변경합니다. 내가 무엇을 올렸는지 링크를보십시오. 당신이 필요로하는 것을 얻기 위해서는 BalusC 쇼와 같은 자바 스크립트를 사용해야합니다. [하이라이트 클릭 행] (http://balusc.blogspot.com/2006/06/using-datatables.html) #HighlightRowsOnClick) sample 또는 jQuery를 중복으로 제공 한 링크로 사용합니다. –