Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.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中的对话框显示表中选定行的数据_Sapui5_Selected - Fatal编程技术网

我无法使用sapui5中的对话框显示表中选定行的数据

我无法使用sapui5中的对话框显示表中选定行的数据,sapui5,selected,Sapui5,Selected,单击表的特定行后,它将在对话框中显示详细信息。 这是我的密码 onMessageDialogPress: function (oEvent) { var oSelectedItem = oEvent.getSource().getParent(); var oBindingContext = oSelectedItem.getBindingContext(); if (!this._oDialog){ this._oDial

单击表的特定行后,它将在对话框中显示详细信息。 这是我的密码

 onMessageDialogPress: function (oEvent) {

       var oSelectedItem = oEvent.getSource().getParent();
       var oBindingContext = oSelectedItem.getBindingContext();

       if (!this._oDialog){
            this._oDialog = sap.ui.xmlfragment("mycompany.app.MyMasterDetailApp.view.Dialog", this);
       } 

       this._oDialog.setBindingContext(oBindingContext);
       this._oDialog.open();
  }

我的问题解决了。我做了一些小的改变,现在它可以正常工作了

这是工作代码

onMessageDialogPress:函数(oEvent){


感谢您如何在对话框中进行绑定。您在对话框中使用的是相对绑定还是绝对绑定?
    var oSelectedItem = oEvent.getSource();
     var oBindingContext = oSelectedItem.getBindingContext();



   if (!this._oDialog){
        this._oDialog = sap.ui.xmlfragment("mycompany.app.MyMasterDetailApp.view.Dialog", this);

   } 

    this._oDialog.setBindingContext(oBindingContext);

    this.getView().addDependent(this._oDialog);
     this._oDialog.open();
     },