Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sorting and Updating HTML table

843836Nov 22 2004 — edited Nov 27 2004
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) {
  }

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 25 2004
Added on Nov 22 2004
4 comments
231 views