I have a one-to-one relationship, and have a combobox for selecting the other one. How do I change the display name of the combo box?
Here's a screenshot of the combo box, to make myself clear:
I'm new to grails, and are attempting to create a simple data-driven app for in house use.
Edit: My toString():
def toString = { "${naam} [${gemeente}]" }
Override the toString
method of said domain class.
String toString() {
return this.name;
}
In Grails 3, the following works:
String toString() {
return "${name}"
}
in your example, this would be:
String toString() {
return "${naam} [${gemeente}]"
}
cheers!
sig需要是String toString() { ... }
(你返回一个def,它是一个闭包,而不是一个方法)
在grails中,select标签还有一个名为“optionValue”的可选属性,允许您定义要显示的bean字段/属性。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.