I've spent couple of weeks on building a datatables showing an uptodate information (about every 10 secs) from a server. I'm so close done but i think i hit a major problem - which is the underlying design on creating/using datatables could be totally wrong (sob!). Since i do not know how to put a print screen on stackoverflow, here is the summary in short:
- A JSP page send a request to a server every 10 secs.
- The response coming back from the server has the uptodate information.
- The response coming back is in XML form. The XML has table elements (with table id=snaptable). Basically a DHTML.
- The JSP page insert this XML (having table id=snaptable) into a DIV element in this page.
- Create a datatable based on this table id=snaptable.
- Repeat this every 10 secs - each time recreate the new table id=snaptable based on the new information from the response.
This works very well.
Here's the issue:
1. If i go the page 2, after 10 sec it automatically goes back to page 1
2. I think what happen here is since every new information comes in every 10 sec is a new instance of datatable (remember - i recreate a datatables every 10 secs), hence it automatically goes back to page 1.
What i want is if i'm in page 2 or page 3, i want to remain on that page while datatables get a refresh every 10 secs. I think i have a wrong design and feel awful due to all the effort i have put in. How to solve this in the shortest way?
Please advice. Thanks