0

を使用してアプリケーションを開発していますGrails 3.3.10。ドロップダウン リストを作成しようとしていますが、空になっています。値をapplication.ymlファイルに入れています。以下は私のコードです。

アプリケーション.yml:

profile:
   accType: ['supplier', 'buyer', 'both']

ドメイン:

class Profile {
String accType
static constraints = {
accType(nullable: true, InList: Holders.config.getProperty('profile.accType'))
  }

} 

_form.gsp

<g:select required="" style="width:auto;" class="form-control input" name="accType" from="${Profile.constrainedProperties.accType.inList}" value="${profileInstance?.accType}" valueMessagePrefix="profile.accType"/>
4

1 に答える 1