Grails g:选择设置 selectedIndex
如何在
我尝试在闪存中传递新对象,但我不知道如何获取它在用于生成 g:select 数据的列表中的索引。
How do you set the selectedIndex on a <g:select> tag with a value from the list? I have a page that allows you to add a record. the page then goes to a view containing a g:select and i want the g:select to default to that item i just inserted into the database.
I tried passing the new object in the flash but i can't figure out how to get it's index in the list being used to generate the g:select data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您在控制器级别的 flash.book 中存储 Book 对象,您的第二页可能如下所示:
Supposing you store a Book object in flash.book at the controller level, your second page could look like this :