tags:

views:

28

answers:

1

I am handed a task to implement a (web) list component (in Java, but inspirations may come from programmers using other platform) that would render as a table with following requirements:

  1. Database paging. The list could contain several thousands of rows. At one time, the component could only hold a subset of the list in memory.
  2. Buffered "inline edit". (I'm not even sure this is the right term.) User may change data on any row, but the change should not be flushed/committed to the database just yet, not until the user hit "save" button.
  3. User may sort the table from any column, or create filters.

I'm thinking a solution that goes like this:

  1. I will implement a 'buffer' store that is queryable and cluster proof. Something like db4o (http://www.db4o.com/). I'm not sure whether choosing this particular component is wise.., but you get the idea.
  2. on flow start (flow==between initial page load and 'save' button clicked) , the whole (unfiltered) list is loaded into the store. The list component will query against this temporary store.
  3. Any changes to the data during this flow will be made against object in the store.
  4. when user click 'save', all dirty data in the store will be comitted back to the relational database.

What do you think of this solution?

Is there a particular component/technology I should try for the temporary store?

A: 

We have similar functionality implemented in our project, albeit in Javascript using ExtJS.

You can find a demo here

Mihir Mathuria
Interesting. So in this case extJS store object will act as the buffer store?Does it have search functionality?How is its performance if it have to manage thousand rows of data?
bungrudi
Correct. Search is also supported, though you will have to combine different components here.We too have thousands of rows. Our grid only displays 50 rows and holds another 50 rows in the buffer. As the user scrolls through, the grid fetches new rows from the buffer and the buffer fetches new rows from the server via ajax calls.The search box is a seperate component on top of the grid. The search happens on the server and the grid is then updated with the results from the search.
Mihir Mathuria
Ok I'll take note on this suggestion. But I'm looking for something in the Java layer. Also, unfortunately, we're not currently using extJS. I have a plan to propose extJS (apart from this suggestion) though for future projects.Thanks for this.
bungrudi