In my view, i have to collect demographics of the customer.Based on a 'yes''no' condition i have to display a address section, which has a button for adding address.So,when the user clicks on that "ADD Address", I have to display the same section again; which contains all the required information to be displayed to the user.So, this button has to generate this section on 'ON-CLICK' and remove when "Clicked remove". My question is how can you bind data with Spring MVC 3 for these on fly creations and removal.I can't do hide and show div operations, as the user can select 'n' address.
问问题
440 次
1 回答
0
不要完全想象这个问题,但是“我不能隐藏和显示 div 操作”削减了很多选项,因为在我看来,这确实是 jquery 或 javascript 等的一个案例,传递了完整的模型和填充您需要的位(您确实用 jquery 标记了这个?)。
如果您无法使用服务器端,则选项包括:
- 如果他们选择 Y 条件来显示地址,则具有不同的视图并转到带有地址的第二个表单。
- 在模型中使用对象,例如列表和数组,它们可以让您绑定到 n 个对象并将它们发送回控制器,例如 List。请参阅如何将对象列表绑定到 SpringMvc 控制器?或Spring 3 MVC - 高级数据绑定 - 带有简单对象列表的表单请求
于 2012-07-24T21:20:35.900 回答