File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Searching in DataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Searching in DataTable" Watch "Searching in DataTable" New topic
Author

Searching in DataTable

aanshu gupta
Greenhorn

Joined: Feb 08, 2010
Posts: 23
Hi all,
I have a datatable which contains thosands of records. User can see 25 records at a time and can move next, previous etc.

What i want now is that initially when the page loads the datatable is not shown. And when the user enters any information in a textbox and clicks search button then only those records matching the criteria should be shown. The page should noit refresh again and again.
Please help me. I am stuck at this.
thanks,
anshu gupta

Anshu Gupta, Persistent Systems Limited, India
SCJP 5.0, SCWCD 5.0
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

This is the sort of problem that AJAX was developed to handle.

RichFaces is one of several JSF extensions that can do what you're looking for. Basically, you'd set up a dataTable with a scroller attached to it to allow for paging. Use the RichFaces reRender attribute on the scroller to indicate that just the displayed table should refresh and not the entire page. Also use the "rendered=" attribute to hide the datatable until the query has been made.

These are powerful tools and they'll make what you want done fairly simple.


Customer surveys are for companies who didn't pay proper attention to begin with.
aanshu gupta
Greenhorn

Joined: Feb 08, 2010
Posts: 23
Thanks for your reply.
But i am using Apache Myfaces and Trinidad.
So how to use paging in Apache.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

MyFaces Tomahawk has a paging control.
aanshu gupta
Greenhorn

Joined: Feb 08, 2010
Posts: 23
Yes..but have to implement it using trinidad only.
Cant use Tomahawk.
Thanks for your quick reply.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

Trinidad is also part of MyFaces and the only technical issues in combining them will be listed in the official Apache documentation.

Political issues, on the other hand, are your own problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Searching in DataTable