As usual dropdown used for relations. Create a domain PriorityType
and define instead of String priorityType
reference to this domain PriorityType priorityType
.
In other case you can create a dropdown from enum values. Here the 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 also this question how to use select+enum