cfwheels,从不成功的模型更新中获取错误

发布于 2024-12-22 13:42:30 字数 130 浏览 4 评论 0原文

我正在尝试在编辑后更新具有嵌套属性的模型。

更新失败,但我使用 #errorMessagesFor(objectName='myobject')# 没有收到任何错误。

知道如何找到原因吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我的影子我的梦 2024-12-29 13:42:30

我将对数组中的每个对象使用 allErrors() 方法。

for (local.object in myObject.arrayOfObjects) {
    if (local.object.hasErrors()) {
        WriteDump(var=local.object.allErrors(), abort=true);
    }
}

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);
    }
}
酸甜透明夹心 2024-12-29 13:42:30

您可能想尝试 Wheels google 组并包含一些代码示例。

如果在控制器中发生错误后执行重定向,则出现错误的模型对象不存在,则必须执行渲染分页器。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文