I've got a webflow view where I want to render a model. The model is from a third-party jar file and can't be serialized. Here is what I want to do (below). This gives me a grails webflow error about not being able to pass in a LinkedHashMap into a model. I thought I can pass whatever I want in a render model.
basicPlanList {
PlanCollection plans = Plan.all(new HashMap<String, Object>());
render(view: "basicPlanList", model: [plans: plans.data])
on("continue") {
bindData(flow.order, params)
}.to("addOnsList")
}
The Plan and PlanCollection are from a third-party and are not serialized. I've tried setting up an action to load the Plan model into the flow, but grails complains with a serialization error:
first {
action {
PlanCollection plans = Plan.all(new HashMap<String, Object>());
[plans: plans.data]
}
on("success").to "basicPlanList"
on("error").to "handleError"
}
My workaround so far is to just load the model in the gsp and bypass the web flow crap:
<g:each in="${Plan.all(new HashMap<String, Object>()).data}" status="i" var="plan">
It works, but I'd rather pass the model to the gsp, not have the gsp calling a remote third-party server to load data without any error checking/capture.
The grails api has an example for Action States:
listBooks {
action {
[bookList: Book.list()]
}
on("success").to "showCatalogue"
on(Exception).to "handleError"
}
Works great if you have a serialized domain class, which I do not.