Rupesh,

I am working on something like this right now . I haven't implemented sorting,
but the other things you've asked for aren't too hard. Here is a snippet:


<table name=<%=i%> width=675 border=1 cellspacing=0 cellpadding=0>
<!--Begin JSP Generated Dynamic Rows -->
<%
for (int i = 0; i < vector.size(); i++) { // Display 1 row for each record %>
     <tr>
          <td width=60 align=center>
               <input type="radio" name="radioDefault" value="<%=i%>"
                    onClick="setDefault(value)"<%
               if (i == default)) {
                    out.print("checked");
               }  %> >
          </td>
          <td width=175 align=center>
               <% out.println(hashtable1.get(hashtable2.get(hashtable2.get
                    (vector.elementAt(i).toString())))); %>
          </td>
          <td width=175 align=center>
               <% out.println(hashtable1.get(hashtable2.get
                    (vector.elementAt(i).toString()))); %>
          </td>
          <td width=175 align=center>
               <% out.println(hashtable1.get(vector.elementAt(i).toString()));
%>
          </td>
          <td width=60 align=center>
               <input type=checkbox name="ChkDelete<%=i%>" value="<%=i%>"
                    onClick=setDelete(<%=i%>)>
          </td>
     </tr>
<% } %>
<!--End JSP Generated Dynamic Rows -->
</table>

Basically, you can just open up a for loop in JSP, temporarily close it, print
out all the HTML you want, then open JSP again to close the for loop off. You'll
see here that I periodically pop back into JSP to fill in some of my table
cells.

I hope this helps you out.

Regards,

Dan Boxwell



Rupesh Choubey <[EMAIL PROTECTED]>
09/14/99 12:54 AM GMT
Please respond to Rupesh Choubey <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:    (bcc: Daniel L. Boxwell)
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.



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.

Reply via email to