Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/380.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
Javascript 如何在展开的面板sapui5中添加标签_Javascript_Dialog_Panel_Sapui5 - Fatal编程技术网

Javascript 如何在展开的面板sapui5中添加标签

Javascript 如何在展开的面板sapui5中添加标签,javascript,dialog,panel,sapui5,Javascript,Dialog,Panel,Sapui5,嗨,我有一个对话框,其中包含一个面板,我应该展开它并显示一个文本/标签或另一个带有一些文本的控制器。 我成功地完成了面板的工作,但我不知道如何在扩展的面板中显示标签。(我找不到任何不使用xml的js示例) 这是我的密码: var panel = new sap.m.Panel("panel-1", { /* justifyContent : sap.m.FlexJustifyContent.Center,*/ header

嗨,我有一个对话框,其中包含一个面板,我应该展开它并显示一个文本/标签或另一个带有一些文本的控制器。 我成功地完成了面板的工作,但我不知道如何在扩展的面板中显示标签。(我找不到任何不使用xml的js示例)

这是我的密码:

var panel = new sap.m.Panel("panel-1", {
            /*      justifyContent : sap.m.FlexJustifyContent.Center,*/
                    headerText:(oError.message),
                    width : '100%',
                    expandable: true
                });
var dialog = new Dialog({
                title: "There was an error while trying to resend the message",
                contentWidth: "500px",
                resizable: true,
                type: 'Message',
                state: 'Error',
                /*content: new sap.m.Label({
                    id : 'labeldialog',
                    justifyContent : sap.m.FlexJustifyContent.Center,
                    text: JSON.parse(oError.response.body).error.message.value,
                }),*/
                content: [panel],

            beginButton: new sap.m.Button({
                text: 'Close',
                press: function () {
                    dialog.close();
                }
            }),

            afterClose: function() {
                dialog.destroy();
            }
        });

        dialog.open();
我应该使用什么来实现控件,以便在折叠部分中放置字符串或参数。多谢各位

你试过这个吗

var panel = new sap.m.Panel("panel-1", {
                headerText:(oError.message),
                width : '100%',
                expandable: true,
                content: [ new sap.m.Text("someId", { "Your message here" })]
            });