View

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















最終更新:2013年07月22日 02:25