grails 通过单选按钮设置 bean 值

发布于 2024-08-30 17:52:22 字数 277 浏览 2 评论 0原文

我对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一城柳絮吹成雪 2024-09-06 17:52:22

您是否尝试过将单选按钮的名称设置为 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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文