I will be extending it to work with lists where there is an id and description. The description will be presented for editing, the id carried in the background.
The advantage is that the entire list is visible at once. I present it as a JavaScript popup so it does not need any menus, in fact it is faster and more convenient to leave it up and switch in and out of it, or kill it and fire up a new one from the underlying page menu. Updates are done simply by editing in place and clicking the save button.
Bill
Source:
<%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
<html xmlns:db="http://www.wap-force.com/dbforms">
<head>
<db:base/>
<title>Category Management</title>
<link href="dbforms.css" rel="stylesheet"/>
</head>
<body class="clsPageBody">
<table align="center" border="0" width="100%" cellspacing="0" cellpadding="1" class="clsMainMenuTable">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="clsMainMenuTable">
<tr class="clsMainMenuTableRow" align="center">
<td style="font-weight: bold">
<span class="clsMainMenu">Prayer Categories</span>
</td>
</tr>
</table>
<db:dbform multipart="false" autoUpdate="true" followUp="/categoriesList.jsp" maxRows="*" tableName="categories">
<db:header/>
<db:errors/>
<table width="280" align="center" border="0">
<db:body>
<tr >
<td width="40">
<db:associatedRadio name="radio_category"/>
</td>
<td align="left">
<db:textField styleClass="clsInputStyle" size="30" fieldName="category"/>
</td>
</tr>
</db:body>
</table>
<db:footer>
<table width="280" border="0" align="center" >
<tr valign="middle">
<td colspan="3">
<hr/>
</td>
</tr>
<tr align="center">
<td>
</td>
<td align="left">
<db:deleteButton associatedRadio="radio_category"
styleClass="clsButtonStyle" caption="Delete Selected"/>
</td>
<td align="left">
<db:updateButton styleClass="clsButtonStyle" style="width:90" caption="Save Above"/>
</td>
</tr>
<tr>
<td style="font-weight: bold">
Add
</td>
<td>
<db:textField fieldName="category" size="30"/>
</td>
<td>
<db:insertButton caption="Insert" showAlways="true" />
</td>
</tr>
</table>
</db:footer>
</db:dbform>
</body>
</html>
Base Table:
<table name="categories"
defaultVisibleFields="category" >
<field name="category" fieldType="varchar" size="30"
isKey="true"/>
<field name="created" fieldType="datetime" size="19"/>
<field name="created_by" fieldType="varchar" size="30"/>
<field name="modified" fieldType="timestamp" size="14"/>
<field name="modified_by" fieldType="varchar" size="30"/>
</table><<attachment: categories_popup.JPG>>
