【发布时间】:2016-10-19 14:25:40
【问题描述】:
您好,我有一个对话框,其中包含一个面板,我应该展开它并显示一个文本/标签或另一个带有一些文本的控制器。 我设法做面板的东西,但我不知道如何在展开的面板内显示标签。(我找不到任何用 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();
我应该使用什么来实现控件,以便将字符串或参数放在折叠部分中。谢谢。
【问题讨论】:
标签: javascript dialog panel sapui5