0
我有一些样本列表,其中有测试列表。我将设置属性添加到html:复选框。当复选框被选中时,添加变量的值不会改变。复选框没有更新Struts上的属性
<logic:iterate id="samples" name="<%=formName%>" property="samples" indexId="sampleIndex"
type="Sample">
<tr>
<td>
<span class="itemNumber">
<bean:write name="samples" property="accessionNumber"/>
</span>
</td>
<td>
<bean:write name="samples" property="sampleType"/>
</td>
<td>
<ul>
<logic:iterate id="tests" name="samples" property="tests" indexId="testIndex"
type="Test">
<li class="test-name">
<html:hidden name="tests" property="testId" indexed="true"/>
<label>
<html:checkbox name="tests" property="added" indexed="true" value="true"/>
<bean:write name="tests" property="testName"/>
<bean:write name="tests" property="added"/>
</label>
</li>
</logic:iterate>
</ul>
</td>
</tr>
</logic:iterate>
当我访问样本时,我得到了未修改的列表。
dynaForm.get("samples");
我设置的值的样本是这样的:
PropertyUtils.setProperty(dynaForm, "samples", possibleSampleList);
有人可以帮助我了解为什么它不改变属性的值“加”
你在说什么变数? – 2014-12-04 09:49:50
复选框的属性,'已添加' – 2014-12-04 09:51:27
在您定义列表的位置发布代码。 – 2014-12-04 09:58:16