Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sapui5 如何获取最佳实践CRUD的POST数据(更新)_Sapui5_Hana - Fatal编程技术网

Sapui5 如何获取最佳实践CRUD的POST数据(更新)

Sapui5 如何获取最佳实践CRUD的POST数据(更新),sapui5,hana,Sapui5,Hana,我们想更新/编辑客户的数据。因此,我们已经尝试了示例中的原始代码。该示例运行良好,但在将用户输入写入数据库之前,我们通常必须检查用户输入。这是我的密码: /** * Event handler (attached declaratively) for the view save button. Saves the changes added by the user. * @function * @public */ onSave: func

我们想更新/编辑客户的数据。因此,我们已经尝试了示例中的原始代码。该示例运行良好,但在将用户输入写入数据库之前,我们通常必须检查用户输入。这是我的密码:

    /**
     * Event handler (attached declaratively) for the view save button. Saves the changes added by the user.
     * @function
     * @public
     */
    onSave: function() {
        var that = this,
            oModel = this.getModel();

        // abort if the  model has not been changed
        if (!oModel.hasPendingChanges()) {
            MessageBox.information(
                this._oResourceBundle.getText("keine Änderungen"), {
                    id: "noChangesInfoMessageBox",
                    styleClass: that.getOwnerComponent().getContentDensityClass()
                }
            );
            return;
        }
        this.getModel("appView").setProperty("/busy", true);
        if (this._oViewModel.getProperty("/mode") === "edit") {
            // attach to the request completed event of the batch
            oModel.attachEventOnce("batchRequestCompleted", function(oEvent) {
                var oParams = oEvent.getParameters();
                if (oParams.success) {
                    that._fnUpdateSuccess();
                } else {
                    that._fnEntityCreationFailed();
                }
            });
        }
        oModel.submitChanges();
    },
我如何访问请求数据?我试着查看oModel DOM,但只找到了
一个包含大量无用内容的索引。甚至
window.location.search
都不是解决方案。

我们已经解决了


只需使用
this.\u getFormFields(this.byId(“newEntitySimpleForm”)

尽管您已经回答了您的问题。。在将数据上载到后端之前,是否需要对其进行清理/验证?是的,我们需要在上载之前对其进行清理。我们已经找到了一个很好的类来这样做: