Selectの必須選択解除
owner(nullable: true)
noSelection="['null':'---']"
<div class="fieldcontain ${hasErrors(bean: horseInstance, field: 'stable', 'error')} required">
<label for="stable">
<g:message code="horse.stable.label" default="Stable" />
<span class="required-indicator">*</span>
</label>
<g:select id="stable" name="stable.id" from="${gapp.Stable.list()}" optionValue="stableName" optionKey="id" required="" value="${horseInstance?.stable?.id}" noSelection="['null':'---']" class="many-to-one"/>
</div>
※StableController
def list(Integer max) {
params.max = Math.min(max ?: 100, 100)
[stableInstanceList: Stable.list(params), stableInstanceTotal: Stable.count()]
}
最終更新:2013年07月22日 02:25