Sapui5 具有上下文绑定的表

Sapui5 具有上下文绑定的表,sapui5,Sapui5,我是SAP的实习生,我在SAPUI5中对XML视图中的表进行上下文绑定时遇到了一些问题 因此,我试图在XML视图中的SAPUI5中创建一个对话框面板,这样,如果我单击表中的某一行,则会在其上方出现一个单独的弹出窗口/面板,并显示有关我单击的产品的更多信息 我让它与javascript一起使用: var details = new sap.m.Panel("details",{ headerText: "This is the {name}",

我是SAP的实习生,我在SAPUI5中对XML视图中的表进行上下文绑定时遇到了一些问题

因此,我试图在XML视图中的SAPUI5中创建一个对话框面板,这样,如果我单击表中的某一行,则会在其上方出现一个单独的弹出窗口/面板,并显示有关我单击的产品的更多信息

我让它与javascript一起使用:

            var details = new sap.m.Panel("details",{
            headerText: "This is the {name}",
            visible: false,
            content: [
                new sap.m.Table({
                alternateRowColors: true,
                fixedLayout: false,
                sticky: sap.m.Sticky.ColumnHeaders,
                columns:[
                    new sap.m.Column({
                        header : new sap.m.Label({
                            text : "This is the Number of failed Tests: {coverage}"
                        })
                    }),
                    new sap.m.Column({
                        header : new sap.m.Label({
                            text : "This is the Number of Bugs: {unitTestCoverage}"
                        })
                    }),
                    new sap.m.Column({
                        header : new sap.m.Label({
                            text : "This is the P/F ratio: {unitFirstCoverage}"
                        })
                    })
                    ]})
//                  dataTable
            ]
        });
在XML中,我的详细信息面板如下所示:

            <!--Details Panel!-->
            <Panel id= "details" 
            headerText= "This is the {data>name}" 
            visible= "false">
                <content>
                    <Table>
                        <columns>
                            <Column>
                                <header>
                                <Label text="This is the Number of failed Tests: {data>coverage}" />
                                </header>
                            </Column>
                            <Column>
                                <Label text="This is the Number of Bugs: {data>unitTestCoverage}" />
                            </Column>
                            <Column>
                                <Label text="This is the P/F ratio: {data>unitFirstCoverage}" />
                            </Column>
                        </columns>
                        <items>

                        </items>
                    </Table>
                </content>
            </Panel>
我怀疑我在尝试用XML调用“详细信息”面板中的数据时出错了,以及数据最后如何绑定

var sPath = oSelectedItem.getBindingContextPath()

旁边:

oProductDetailPanel.bindElement({ path: 'data>' + sPath });

感谢您的回复,但这似乎并没有解决问题,因为我得到的结果与获取项目索引号之前的结果相同,但这对显示数据不起作用(我使用了console.log并看到它为我提供了与我按下的特定项目对应的“/0”或“/3”)我认为我们应该有oProductDetailPanel.bindElement({path:'data>'+sPath});
var sPath = oSelectedItem.getBindingContextPath()
var sPath = oSelectedItem.getBindingContext('data').getPath()
oProductDetailPanel.bindElement({ path: 'data>' + sPath });