tableView.jsp


<%! String FontSize="2"; %>
<html>
<head>
    <link rel="stylesheet" href="css/mi.css" type="text/css">
<!-- href uses "standard" ME settings: 127.0.0.1 = localhost on the Desktop and also works on the PDA -->
    <a href="http://127.0.0.1:4444/me" > <img src="mimes/SAP_me.gif" alt="Back to ME Home" ></a>
</head>
<body>
  <jsp:useBean id="dataBean" scope="session" class="genericsyncexample1.bean.TableViewBean" />

<!-- Disply title of the example -->
  <h4><%=dataBean.getString() %></h4><br>

<!-- Table definition -->
   <%

     String rowClass  = "miHeader";
     String bgColor = "#9CAECE";
     String cellClass = "1stCellBody";
   %>
   <table width="100%" bgcolor="#D4E2EE" border="1" cellpadding="1" cellspacing="0" >
    <tr bgcolor="<%=bgColor %>" class="<%=rowClass%>">
<!-- The entries in row 0 are used as headline of the table - so we change background color -->
        <td class="1stCellHeader"><%=dataBean.getTableContent(0,0) %></td>
        <td class="nextCellHeader"><%=dataBean.getTableContent(0,1) %></td>
    </tr>
    <%

      int cols = dataBean.getTableColumns();
      int rows = dataBean.getTableRows();
      rowClass  = "miBody";
      for(int i=1; i < rows; i++) {
// begin of a row 
/// To make the tableview look nicer, we use alternating colors for rows (light blue and light grey)
           if (bgColor.compareTo("#DCE3EC") == 0) {
// light blue
               bgColor = "#CBD5E1";
           } else {
// lighter blue
               bgColor = "#DCE3EC";
           }
      %> <tr bgcolor="<%=bgColor %>" class="<%=rowClass%>"> <%

       for(int j=0; j < cols; j++) {
         cellClass = "1stCellBody";
         if (j > 0) cellClass = "nextCellBody";                               
         %> <td align="left" valign="top" class="<%=cellClass%>" > <%=dataBean.getTableContent(i, j)%> </td> <%

       }
// end of a row 
       %> </tr> <%       
      }
    %>  
  </table>
</body>
</html>