I have a table of data for a policy type (options are Single, Couple, Family & Single Parent Family). I want to have a tabbed interface with each policy type occupying one tab. At the same time a table of data relating to relevant policy type is displayed beneath the associated tab. When a user clicks on another tab then a different table of data is displayed.
I thought about exporting the data from the database then converting this to XML and therefore parsing this to HTML via XSLT and/or jQuery. I think this is overkill as it is just a simple table.
What i would like to do is do all the processing on an external server page, in this case JSP and just swap out chunks of HTML. So the user clicks on a tab which calls the external JSP. The external JSP then retrieves the data for the relevant tab, builds the table and then this is displayed on screen. Or could the external JSP query the database, build all four table with a unique id each and then the jQuery loads only the table that has been called. Finally would it be easier just to have four seperate HTMLs build via JSP and then call them individually? I would prefer just one HTML to be honest.
I don't know if it defeats the object of AHAH if the tables are built on request by a JSP and then served to the client. I was also concerned that if we query the database and build the tables then how will it be able to update the content of tables if the database data changes.
I thought also this could all be done on the page i.e. build 4 tables and hide the ones that don't relate to the active tab with CSS display:none but i wasn't sure about accessibility - would screen readers pick up this data?
Apologies if this does not make sense and i feel i may be trying to over complicate this but i am just trying to figure best approach. And it is late :(
See Question&Answers more detail:os