add.jsp


<html>
<head>
     <link rel="stylesheet" href="css/mi.css" type="text/css">
</head>
<body>
 <jsp:useBean id="tableViewDefinition" scope="session" class="mdkInventory1.bean.TableViewDefinition" />  
 <jsp:useBean id="dataHandler" scope="session" class="mdkInventory1.bean.BasicDataHandler" />  

<!-- For event handling we need a HTML "form" command -->
 <form method="post" action="start" id="form1" name="form2">
<!-- Disply title of the example -->
 <font face="'Arial Narrow',sans-serif">
    <!-- Display header panel -->
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#fffbd5">
      <tr bgcolor="#fffbd5" class="headerPanel">
          <td align="left" valign="middle" class="headerPanel" ><%=tableViewDefinition.getHeaderPanelEntryLeft() %> </td>
          <td align="right" valign="middle" class="headerPanel" ><%=tableViewDefinition.getHeaderPanelEntryRight()%> </td>
      </tr>
  </table>
<!-- Command line - contains the commands add, delete etc.. The commands are separated by 2 blanks-->
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#fffbd5">
      <tr bgcolor="#fffbd5">    
      <td class="commandLine" width="20%">
        <input type="submit" value="Add" class="image" name="_event_addEntrySubmit" >          
      </td>
      <td class="commandLine">
<!-- In constants.jave we refer to the event as EVENT_NAME = "name" . The AbstractMEHttpServlet analyses 
     the string "_event_name" and passes "name" to the "doHandleEvent" method as "eventName" -->
        <input type="submit" value="Cancel" class="image" name="_event_addEntryCancel" >          
      </td>
      </tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#fffbd5">
      <tr bgcolor="#fffbd5">              
<!-- Title of page -->
        <td class="centerPageTitle"><%=tableViewDefinition.getCenterPageTitle()%></td>
      </tr>
  </table>
  
<!-- Table definition -->
  <table width="100%" bgcolor="#D4E2EE" border="0" cellpadding="0" cellspacing="0">
    <%

      int cols = 2;
      int rows = dataHandler.getColumns();
// Background color for title row
      String bgColor = "#FFFFFF";
      String rowClass  = "miBody";
// begin table with table header 
      for(int i=1; i < rows; i++) {
       if (dataHandler.getTableHeaderName(i) != null) {
      %> <tr bgcolor="<%=bgColor %>" class="<%=rowClass%>" > <%

       for(int j=0; j < cols; j++) {
// In the first column (except the title row) we display a checkbox, that can be used to mark an entry 
/// that should be deleted. The checkbox gets the name which is supplied by the tableViewDefinition. This name is 
/// used in the servlet to determine which entry should be deleted
            if (j == 0) {
         %> <td width="25%"><%=dataHandler.getTableHeaderName(i)%> </td> <%

            } else {
// Column 2 and higher displays the Car entity and License entity.
         %> <td> 
             <INPUT TYPE="Text" Name="<%=dataHandler.getTableHeaderName(i) %>" Value="" style="padding-bottom:0; padding-top:0" ></td> <%

            }
       }
       } 
// end of a row 
       %> </tr> <%

      } %>
  </table> 
 </font>
 </form>
</body>
</html>