The excel export is a pretty good idea. At my day job we're doing that for some reports, so now you got me thinking.
A custom component would probably work, but I was thinking you could also write a standard function to handle this.
1) Bind the table to a bean propery
2) Have a link that calls an 'exportExcel' function or something similar
3) Get the DataModel and the column children
4) Loop through the data model rows, then through the column children for each row, and build the file (JExcel or apache's POI)
How to deliver the file I'm not too clear on. From what I've read you can short circuit the response writting, so your action handler function can just write the excel file. I do not know if that's true but I think it'll work.
That aside, most non-Sun JSF impemenations have some sort of data table with sorting capabilities. And if you are stuck just using Sun's RI it's easily done. I made a plain h:dataTable sortable with my own links and backing bean methods. It really wasn't that difficult. But still easier if all that is wrapped up in a tag like MyFaces data table.
Originally posted by Daniel Prene:
hmm.. Thank you all for your help. I really apreciate it. Is there a chance I could see the source for your sortable data table? Although, the ability to grab new data without page refresh is always tempting... Thanks for the suggustions. Any other words of advice?
I don't have the source. It was written for a job.
Originally posted by Kristin Stromberg:
None of the hard part (the sorting) would have to be coded in JS. Just the easy stuff. AJAX just does the magical part of pulling the info from the server without having to reload the form. I think this would be a really nice solution for your problem!
I don't see how none of the sorting would have to be done with JS. When you have the page, it's HTML. The only way to reorder the data in HTML is using JS. Sure, the data would come back differently, but you can't refresh the page to redisplay the data if you are going to use AJAX, hence, JS would need to redraw your table for you with the data in the order you want.