aspose file tools
The moose likes JSF and the fly likes Richfaces Scrollable Datatable with filtermethod not working Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Richfaces Scrollable Datatable with filtermethod not working" Watch "Richfaces Scrollable Datatable with filtermethod not working" New topic
Author

Richfaces Scrollable Datatable with filtermethod not working

amitraj bharat
Greenhorn

Joined: Jul 23, 2008
Posts: 6
I have scrollable datatable, in which i have implemented custom filter using filtermethod in column tag. I can see the scroll bar and able to scroll but I have 2 problems
1) Custom filter is not working
2) Sorting is not working
Everything works fine if i use plain simple Datatable but I need scroll bar for my datatable.
I am putting both the flavours of my page

Please can anyone tell me what is going wrong ?

here's my code using scrollableDataTable :
Code:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<f:view>
<html>
<head>

<title>Insert title here</title>
</head>
<body>
<h:form>
<h:panelGroup>
<hutputText value="Search"/>
<h:inputText value="#{filteringBean.filterValue}" id="searchinput">
<a4j:support event="onkeyup" reRender="table" ignoreDupResponses="true" requestDelay="700" />
</h:inputText>
</h:panelGroup>
<rich:spacer height="20px"/>
<rich:scrollableDataTable value="#{patientList.patientList}" var="patients" id="table" sortMode="multiple">
<f:facet name="header">
<hutputText value="Patients List"/>
</f:facet>
<rich:column id="firstname" filterMethod="#{filteringBean.filterPatients}" >
<f:facet name="header">
<hutputText value="First Name" />
</f:facet>
<hutputText value="#{patients.first_name}"/>
</rich:column>
<rich:column id="lastname" >
<f:facet name="header">
<hutputText value="Last Name"/>
</f:facet>
<hutputText value="#{patients.last_name}"/>
</rich:column>
<rich:column id="dob" >
<f:facet name="header">
<hutputText value="DOB"/>
</f:facet>
<hutputText value="#{patients.date_of_birth}">
<f:convertDateTime pattern="MM/dd/yyyy" />
</hutputText>
</rich:column>
</rich:scrollableDataTable>
</h:form>
</body>
</html>
</f:view>

here's code with simple richfaces datatable

Code:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<f:view>
<html>
<head>

<title>Insert title here</title>
<script language ="javascript">
function func()
{
var input = document.getElementById("patientForm:table:searchinput");
input.focus();
input.value=input.value;
}
</script>
</head>
<body>
<h:form id="patientForm">

<h:panelGroup>
<hutputText value="Search"/>



<h:inputText value="#{filteringBean.filterValue}" id="searchinput">
<a4j:support event="onkeyup" reRender="table" ignoreDupResponses="true" requestDelay="700" oncomplete="func();" />
</h:inputText>


</h:panelGroup>
<rich:spacer height="20px"/>

<rich:dataTable value="#{patientList.patientList}" width="700px" var="patients" id="table" sortMode="single" >


<f:facet name="caption"><hutputText value="Patients List" /></f:facet>
<f:facet name="header">
<hutputText value="Patient Data" />
</f:facet>

<rich:column filterMethod="#{filteringBean.filterPatients}" sortBy="#{patients.first_name}" >
<f:facet name="header">
<hutputText value="First Name" />
</f:facet>
<hutputText value="#{patients.first_name}"/>
</rich:column>
<rich:column sortBy="#{patients.last_name}">
<f:facet name="header">
<hutputText value="Last Name"/>
</f:facet>

<hutputText value="#{patients.last_name}"/>

</rich:column>
<rich:column sortBy="#{patients.date_of_birth}" >
<f:facet name="header">
<hutputText value="DOB"/>
</f:facet>
<hutputText value="#{patients.date_of_birth}">
<f:convertDateTime pattern="MM/dd/yyyy" />
</hutputText>

</rich:column>


</rich:dataTable>

</h:form>

</body>
</html>
</f:view>
[ August 27, 2008: Message edited by: amitraj bharat ]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Richfaces Scrollable Datatable with filtermethod not working
 
Similar Threads
Unknown Tag(a4j:form and rich:panel)
Check box column trouble
Rich:Datatable rerendering problem
jsf panelGrid
RichFaces with TabPanel and selectOneMenu not change the tab