My use case : I am using a view which is based on a component as model. In this view, I want an action in order to add a new row to the list.
The component declared in model.groovy :
Component('ComposeLoading') {
//fields
date_time 'etd'
//reference
reference 'offerPlan', ref:'OfferPlan'
//lists
list 'loadings', ref:'Loading'
list 'transportOrders', ref:'TransportOrder'
}
The view declared in view.groovy :
border('ComposeTrain.wizard.first.view', model:'ComposeLoading') {
north {
form {
fields {
propertyView name:'etd'
propertyView name:'offerPlan'
}
}
}
center {
split_horizontal {
left {
table(permId:'ComposeLoading.loadings.table',
model:'ComposeLoading-loadings',
selectionMode:'MULTIPLE_INTERVAL_CUMULATIVE_SELECTION')
}
right {
split_vertical(cascadingModels:true) {
top {
table(permId:'ComposeLoading.transportOrders.table',
model:'ComposeLoading-transportOrders')
{
actionMap () {
actionList('TRANSPORT_ORDER') {
action(ref:'addToMasterFrontAction')
}
}
}
}
bottom {
table(permId:'ComposeLoading.TransportOrders.loadings.table',
model:'TransportOrder-loadings')
}
}
}
}
}
}
My problem : when I run the application and when I click on the Add button, the addToMasterFrontAction fails with : "object is not an instance of declaring class"
Please find below the stacktrace :
ERROR <2015-04-24 08:48:44,014> org.jspresso.framework.application.frontend.controller.AbstractFrontendController : An unexpected error occurred for user demo on session 6b2afee4.
java.lang.RuntimeException: java.lang.IllegalArgumentException: object is not an instance of declaring class
at org.jspresso.framework.util.accessor.bean.BeanCollectionAccessor.addToValue(BeanCollectionAccessor.java:78)
at org.jspresso.framework.application.backend.action.AbstractAddCollectionToMasterAction.execute(AbstractAddCollectionToMasterAction.java:116)
at org.jspresso.framework.application.backend.AbstractBackendController.execute(AbstractBackendController.java:393)
at org.jspresso.framework.application.frontend.controller.AbstractFrontendController.executeBackend(AbstractFrontendController.java:1534)
at org.jspresso.framework.application.frontend.controller.AbstractFrontendController.execute(AbstractFrontendController.java:574)
at org.jspresso.framework.application.action.AbstractAction.execute(AbstractAction.java:114)
at org.jspresso.framework.application.frontend.action.std.AddCollectionToMasterAction.execute(AddCollectionToMasterAction.java:85)
at org.jspresso.framework.application.frontend.controller.AbstractFrontendController.executeFrontend(AbstractFrontendController.java:1547)
at org.jspresso.framework.application.frontend.controller.AbstractFrontendController.execute(AbstractFrontendController.java:576)
at org.jspresso.framework.view.remote.RemoteActionFactory$ActionAdapter.actionPerformed(RemoteActionFactory.java:235)
...