Я разрабатываю приложение, используя Grails 3.3.10
, я пытаюсь создать раскрывающийся список, но я получаю его пустым. Я помещаю значения в файл application.yml
, ниже мой код.
application.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"/>