I use a
Java servlet to create a HTML table. The table is a typical report table with several columns of date, String, integer etc. I want to sort the table by clicking on a column header. I wrote a simple java class for sorting as well . Currently,I call that sort class when I initially create the table and it works the way I wanted it. Now I want to call that class each time a column header is clicked and want to update the current table in the page. Any Suggestions?? please.
This is how I created the table:
public void doPost(
HttpServletRequest request,
HttpServletResponse response)
throws IOException {
PrintWriter out = response.getWriter();
try {
// Creates HTML page header, Starts HTML tages etc
buildReportWebpageHeader(out);
// Builds the Report Table Header (a row containing all the columns)
buildTableHeader(out);
//Builds the rows of the table and also calls the sort class and initialy sorts the table
// data ==> is the actual data used to create the rows. I get that in the init() method.
loadTableData(data, out);
} catch (Throwable t) {
}
}