[英]how to display values in select tag as 10,15,20,25 using grails select tag
[英]How to display a select tag in grails
我已经在form.gsp
页面中输入了此标签以显示select
但它不起作用。您能帮我找到我遇到的错误吗?
<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'role', 'error')} required">
<label for="role">
<g:message code="user.role.label" default="Role" />
<span class="required-indicator">*</span>
</label>
<g:select id="role" name="role.id" from="${taskmanagement1.secu.Role.list()}" optionKey="id" required="" value="${userInstance?.role?.id}" class="many-to-one"/>
</div>
注意:我正在使用Spring Security生成的Role&User域类。
您可以尝试一下吗,我没有测试过,但认为可以
<g:select name="role.id" from="${taskmanagement1.secu.Role.list()}" optionKey="id" value="${userInstance.role*.id}" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.