xiaochong/zkui — Issue #49: scaffolded zkui:select / save problem
Author: lschaffer
Created: 2012-03-05 09:50:18+00:00
State: open

I have the following problem with zkui:select

Domain.class ->
class Device {

static mapping = {
table 'device'
// version is set to false, because this isn't available by default for legacy databases
version false

plantList column:'phd_dev_id',joinTable:'plant_device'
notificationEventList column:'dne_dev_id', joinTable:'device_notification_event'
id generator:'identity', column:'dev_id',insertable:false,updatable:false,lazy:false

}

String devToken
String devAppKey
String devType
String devUser
Date devUpdated
Date devCreated
Date devLastPush
String devLastPushEvent
Boolean devActive
String devPushQtStart
String devPushQtEnd

static hasMany = [ plantList : Plant,notificationEventList:NotificationEvent,dacoUserList:DacoUser ]

static belongsTo = [Device,DacoUser]

static constraints = {
...
}

In the scaffolded device/edit.gsp the NotificationEvents, Plants are listed in a select combo (this part is working well)
(gsp)

However if I click to "update" the following error is being generated
2012-03-05 10:32:54,280 [http-bio-8080-exec-8] ERROR device.EditComposer - grai
ls.validation.ValidationErrors: 2 errors
Field error in object 'at.ks.dacoms.admin.Device' on field 'plantList': rejected
value [[1, 24, 25, 26, 28, 29, 23, 22]]; codes [typeMismatch.at.ks.dacoms.admin
.Device.plantList,typeMismatch.plantList,typeMismatch.java.util.Set,typeMismatch
]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable
: codes [at.ks.dacoms.admin.Device.plantList,plantList]; arguments []; default m
essage [plantList]]; default message [Failed to convert property value of type '
java.util.ArrayList' to required type 'java.util.Set' for property 'plantList';
nested exception is java.lang.IllegalStateException: Cannot convert value of typ
e [java.lang.Long] to required type [at.ks.dacoms.admin.Plant] for property 'pla
ntList[0]': no matching editors or conversion strategy found]

What should I change ?

Thanks
Laszlo Schaffer