我使用Spring MVC的,春天下拉不工作
<form:select class="form-control" id ="cmsphyexamtesttype_cmsPhysicalExamCategory_id" path="cmsPhysicalExamCategory.id">
<form:option value="0" label="--- Please select the Category ---"/>
<form:options items="${cmsphyexamtestcategorys}" itemLabel="name" itemValue="id" />
</form:select>
HTML代码
<select id="cmsphyexamtesttype_cmsPhysicalExamCategory_id" name="cmsPhysicalExamCategory.id" class="form-control">
<option value="0">--- Please select the Category ---</option>
<option value="2">Genaral</option><option value="3">EYE</option><option value="4">HENT</option><option value="5">CHEST</option>
</select>
这一个是工作的罚款与新的形式,但在编辑模式下,它不工作你有任何想法,当它呈现给编辑模式时,它会给出选定的值,我是春天mvc的新手,这个代码有什么问题吗?
代码对我来说很好。 “编辑模式”是什么意思? – marioosh
虽然再次呈现相同的形式用于编辑,我有MVC将默认使用所选属性的问题,并没有改变,值改变,但选择的属性没有改变,从而改变了下拉值不存储 – chinmayahd
请发布控制器方法,用于在“编辑模式”中填充表单 – Ralph