This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes AJAx and Huge tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "AJAx and Huge tables" Watch "AJAx and Huge tables" New topic

AJAx and Huge tables

Dharmesh Chheda
Ranch Hand

Joined: May 08, 2001
Posts: 204

I have a huge table to display which might have around 500-1000 rows based on certain criteria which is based on what the user enters.

My servlet is returning an XML back and I am using the DOM api to navigate through the XML and create dynamic rows for the table.

the problem is that while rendering the page, i.e. creating the rows, my browser blocks user access for the time it is creating the rows and displays all the records at once ..

Is it possible to make each row visible as it is bein added to the table?...

any help will be appreciated.

Me using Java

regards,<br />Dharmesh Chheda
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

One idea: since you are using Java on the back-end, instead of returning XML, return the pre-formatted table markup. This would be easy to do with a JSP.

That would eliminate all the client-side processing necessary to digest the XML and build the corresponding DOM.

This is how I am handling this exact situation in a project I am working on now.

[Asking smart questions] [About Bear] [Books by Bear]
Yasir Bajwa

Joined: May 02, 2007
Posts: 23
I had a similar problem .. i had to display 10000 records, so I built a 'scrolling table' control. I used tables as 'pages', so I would set a page size (e.g. 25 rows) and return a table containing it. The control just appends a bunch of tables together, but to the user it looks like one table. it fetches 'pages' based on scroll position.
Consider Paul's rocket mass heater.
subject: AJAx and Huge tables
It's not a secret anymore!