I'm assuming your table's data is being sourced from a database or similar
and has many repeated rows of data after the column headers.
The way I dealt with the issue of client vs server side processing is to do
EVERYTHING on the server side - after all, the server is the only one you
can be sure has all the features you need enabled. If you rely on client
side processing then you start to restrict which users can view your site
(e.g. if you want to use javascript on your pages or DHTML you rely on all
browsers supporting/enabling those features... which they don't).
So, for your table you could have something like this :
<table>
<tr>
<th><a href="thispage.jsp?sort=1>Field Number 1 (checkbox)</a></th>
<th><a href="thispage.jsp?sort=2>Field Number 2 (text)</a></th>
<th><a href="thispage.jsp?sort=3>Field Number 3 (button)</a></th>
</tr>
<% // get the field to sort on from the request object
sortField = Request.QueryString("sort"); // don't
know if you can do that in jsp as in asp but you get the idea
// get the data from your database here
// e.g. "SELECT * FROM racecarsTable WHERE
builtYear<=1993 ORDER BY " + sortField + ";"
// start your table loop here
%>
<tr>
<td><input name="field1name"
type="checkbox"<%if(field1_value==true){%> checked<%}%></td>
<td><input name="field2name" type="text"
value="<%=field2_value%>"></td>
<td><button name="field3name"><%=field3_value%></button></td>
</tr>
<%
// end your table loop here
%>
</table>
-----Original Message-----
From: Rupesh Choubey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 14, 1999 10:54 AM
To: [EMAIL PROTECTED]
Subject: How to generate complex tables using JSP and useProperty
What would be the (best) way to implement a complex table using JSPs. By a
complex table, I mean one where :
* one of the columns is a button
* one of the columns is a checkbox
* different columns have different display properties (different text
fonts, sizes, etc.)
* rows have different properties - e.g. alternate rows have different
colors, rows might have different colors based on values in columns,
* SORTING needs to be done by clicking column headers
THESE and other similar requirements make the entire JSP task a bit of a
challenge.......
Does anyone have ideas / code / lessons learned ??? Appreciate all help.
This is a big hurdle we are trying to overcome and help would be greatly
appreciated.....
Thank you,
Rupesh.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html