grails 通过单选按钮设置 bean 值
我对 grails 有点陌生(虽然不是很出色),并且正在开发一个示例 CRUD 应用程序。我试图解决的问题是如何在数据库中更新 bean 之前基于单选按钮设置 bean 的属性。是表单助手http://www.grails.org/plugin/form-helper 插件的路要走吗?无论用户实际单击按钮还是保留默认值,bean 都会设置其值吗?
谢谢, 杰夫
I'm somewhat new to grails (not groovy though) and I'm working on a sample CRUD application. The issue I'm trying to solve is how to set a property on a bean based on a radio button before I update it in the database. Is the Form Helper http://www.grails.org/plugin/form-helper plugin the way to go? Will the bean have its value set regardless of if the button is actually clicked by the user or if it is left at its default value?
thanks,
Jeff
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过将单选按钮的名称设置为 bean 属性名称并将单选按钮包含在表单或远程表单提交中?
Have you tried setting the name of the radio buttons to the bean property name and include the radio buttons in your form or remoteForm submission?