• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Richfaces Scrollable Datatable with filtermethod not working

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
<h:outputText 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">
<h:outputText value="Patients List"/>
</f:facet>
<rich:column id="firstname" filterMethod="#{filteringBean.filterPatients}" >
<f:facet name="header">
<h:outputText value="First Name" />
</f:facet>
<h:outputText value="#{patients.first_name}"/>
</rich:column>
<rich:column id="lastname" >
<f:facet name="header">
<h:outputText value="Last Name"/>
</f:facet>
<h:outputText value="#{patients.last_name}"/>
</rich:column>
<rich:column id="dob" >
<f:facet name="header">
<h:outputText value="DOB"/>
</f:facet>
<h:outputText value="#{patients.date_of_birth}">
<f:convertDateTime pattern="MM/dd/yyyy" />
</h:outputText>
</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>
<h:outputText 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"><h:outputText value="Patients List" /></f:facet>
<f:facet name="header">
<h:outputText value="Patient Data" />
</f:facet>

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

<h:outputText value="#{patients.last_name}"/>

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

</rich:column>


</rich:dataTable>

</h:form>

</body>
</html>
</f:view>
[ August 27, 2008: Message edited by: amitraj bharat ]
 
I think I'll just lie down here for a second. And ponder this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic