cfwheels, getting errors from an unsuccessful model update
-
22-04-2021 - |
Question
I'm trying to update a model with nested properties after an edit.
The update fails, but I'm not getting any errors using #errorMessagesFor(objectName='myobject')#
.
Any idea how to get to the cause?
Solution
I would use the allErrors()
method on each of the objects in the array.
for (local.object in myObject.arrayOfObjects) {
if (local.object.hasErrors()) {
WriteDump(var=local.object.allErrors(), abort=true);
}
}
OTHER TIPS
You may want to try the Wheels google group and include some code examples.
If after the error happens in the controller if you do a redirect, the model object with the error doesn't exist, you'll have to do a renderpager.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow