【发布时间】:2013-04-10 03:03:18
【问题描述】:
我有以下 jsp,其中我可以选择添加和删除表格的行,并且在表格的每一行中,我必须填写选项并提交表单。
在动作类中,我如何检索我在 JSP 中填写的行的值,因为我在表格中填写了不止一行?
这是我的 JSP:
<table id="fragmentTable" style="height: 100%; width: 100%">
<tr class="tableRow" style='height: 5%;'>
<td class='' style='position: absolute; left: 75%;'>
<button value="Add Row" type="button" onclick="return addRow1();">Add Row</button>
<button value="Delete Row" type="button" onclick="return deleteRow ('dataTable')">Delete Row</button>
</td>
</tr>
<tr>
<td colspan="2"><br><br>
<table id="dataTable" border="1" width=100% height=30% class='blueBorder'>
<thead>
<tr class='rowHeader'>
<th width='14%'>Select</th>
<th width='14%'>Opening Brace</th>
<th width='14%'>Parameter</th>
<th width='14%'>Relational Operator</th>
<th width='14%'>Value</th>
<th width='15%'>Closing Brace</th>
<th width='15%'>Logical Operator</th>
</tr>
</thead>
<tbody>
<tr class='rowData' id=1>
<td>
<s:checkbox theme="simple" id="sel" name="GRF_FRAGID" value="false" /></td>
<td ><s:select headerKey="-1" headerValue="Select" list="#{'1':'(', '2':'((','3':'(((','4':'((((','5':'((((('}" name="GRF_OPNGBRCES" /></td>
<td>
<s:select label="Mode" headerKey="-1" headerValue="Select" list="#{'1':'=', '2':'!='}"
name="GRF_OP" />
</td>
<td>
<s:textfield name="Country"/>
</td>
</tr>
</tbody>
</table>
【问题讨论】:
-
您有 2 个选项,要么保留已更改的行,要么将整个数据提交到您的操作类。
标签: jsp struts2 struts struts-1 struts2-jquery