私は2つのドメインクラスを持っています:-
class Product {
ProductType productType
int openingQuantity
int unitQuantity
Date dateCreated
Date lastUpdated
boolean active
static constraints = {
productType(blank:false,nullable:false)
openingQuantity(blank:false, nullable:false)
unitQuantity(blank:false, nullable:false)
active(nullable:false)
dateCreated()
lastUpdated()
}
}
と
class ProductType {
String name
Date dateCreated
Date lastUpdated
static constraints = {
name(nullable:false, blank:false,maxSize:50,validator: {
return !ProductType.findByNameIlike(it)
})
dateCreated()
lastUpdated()
}
}
私が製品の create.gsp にいるとき。ドロップダウンにidとしてproductTypeが表示されます。しかし、私の要件は、ドロップダウンに ProductType 名を表示することです。誰でも助けてください。