How to implement a dropdown list from the domain class in grails -
in grails project want implement drop down list. define, string prioritytype in domain class,
it generated normal text field input data. want know how define stage dropdown list contain premium, bold drop down values if can please me this
as usual dropdown used relations. create domain prioritytype , define instead of string prioritytype reference domain prioritytype prioritytype.
in other case can create dropdown enum values. here example:
<div class="fieldcontain ${haserrors(bean: shoppingcenterinstance, field: 'activitystate', 'error')} required"> <label for="activitystate"> <g:message code="shoppingcenter.activitystate.label" default="activity state"/> <span class="required-indicator">*</span> </label> <g:select name="activitystate" from="${activitystate?.values()}" keys="${activitystate.values()*.name()}" required="" value="${shoppingcenterinstance?.activitystate?.name()}"/> </div> see question how use select+enum
Comments
Post a Comment