如何在扩展面板sapui5中添加标签

how to add label inside expanded panel sapui5

您好,我有一个对话框 包含一个面板,我应该展开它并显示文本/标签或带有一些文本的另一个控制器。 我设法做了面板的事情,但我不知道如何在展开的面板内显示标签。(我找不到任何在 js 中制作的例子,而不在 xml 中做)

这是我的代码:

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" })]
            });