View


※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

Selectの必須選択解除
  • Domain
 owner(nullable: true)
  • View
 noSelection="['null':'---']"

  • select
<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()]
}