简体   繁体   English

获取OData Binding的编辑数据

[英]Get edited data of OData Binding

Does anyone know the best approach of getting the changed data of an odata model property after binding it to a form / set of input controls via bindElement ? 有没有人知道通过bindElement将odata模型属性的变化数据绑定到输入控件的形式/集合之后获取更改数据的最佳方法?

Currently I am doing something like this.getView().bindElement('/SomeEntitySet(0815)'); 目前我正在做类似this.getView().bindElement('/SomeEntitySet(0815)'); . But I struggle with getting back the edited data from my view. 但是我很难从我的视图中找回编辑过的数据。 The only methods the binding is offering to me is getting back the odata model itself, which contains the original, non edited data. 绑定提供给我的唯一方法是返回odata模型本身,其中包含原始的非编辑数据。 Does anybody know what I'm doing wrong? 有人知道我做错了什么吗?

In the odataModel there's an Property called refreshAfterChange this should be set to true by default. 在odataModel中有一个名为refreshAfterChange的属性,默认情况下应设置为true。

Are you sure your changes applies to your backend data? 您确定您的更改适用于您的后端数据吗? The oDataModel from sapui5 should update the binding by itself( checkout: mParameters.refreshAfterChange ). 来自sapui5的oDataModel应该自己更新绑定( checkout:mParameters.refreshAfterChange )。 If the Change method work debug your oData service and check if the change method trigger a GET request to your backend(The odatamodel should trigger a get request if the data has been changed => see refreshAfterChange in link above, the refresh of the model will do a GET request like it does if you bind data to an element). 如果Change方法工作调试您的oData服务并检查更改方法是否触发对后端的GET请求(如果数据已更改,odatamodel应触发get请求=>请参阅上面链接中的refreshAfterChange,模型的刷新将像将数据绑定到元素一样执行GET请求。 If not theres something wrong with your model confoiguration. 如果不是你的模型配置有问题。

Could you add the code where and how you initiate the model? 您可以在代码的位置和方式中添加代码吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM