This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android 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: 60822

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] [Bear's FrontMan] [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.
It is sorta covered in the JavaRanch Style Guide.
subject: AJAx and Huge tables
Similar Threads
Update based on Row id
Getting Two Tables to Line Up
determine the number of rows to be saved from a table to an excel sheet
Regarding Div tag and Table header being scrolled
Trinidad's table range navigation control