SAPUI5弹出对话框按钮动态可见性
我有一个SAPUI5弹出对话框,在弹出窗口的页脚部分有几个按钮 我需要根据模型属性的值动态设置弹出窗口中按钮的可见性。有没有办法做到这一点SAPUI5弹出对话框按钮动态可见性,sapui5,Sapui5,我有一个SAPUI5弹出对话框,在弹出窗口的页脚部分有几个按钮 我需要根据模型属性的值动态设置弹出窗口中按钮的可见性。有没有办法做到这一点 that.oNewAppointmentDialog = new Dialog({ title: "{i18n>CreatePopupTitle}", content: [ sap.ui.xmlfragment("Create
that.oNewAppointmentDialog = new Dialog({
title: "{i18n>CreatePopupTitle}",
content: [
sap.ui.xmlfragment("CreateFrag", "proj.view.fragments.AssignmentCreate", this)
],
buttons: [
new Button({
text: "{i18n>CreatePopupText}",
type: "Ghost",
press: function () {
}
}),
new Button({
text: "{i18n>CreatePopupClearButton}",
type: "Ghost",
press: function () {
}
}),
new Button({
text: "{i18n>CloseButton}",
press: function () {
// Close Button Click Event
that.oNewAppointmentDialog.close();
}
})
]
});
使用的属性:
如果yourModel
的属性TrueOrFalse
不是布尔值,则使用:
如何在此场景中使用格式化程序。我只在xml视图中使用过格式化程序
...
new Button({
text: "{i18n>CreatePopupText}",
visible: "{yourModel>TrueOrFalse}"
});
...
...
new Button({
text: "{i18n>yourButtonText}",
visible: {
path: "yourModel>TrueOrFalse",
formatter: function(sArgument) {
return yourApp.model.formatter.yourMethod(sArgument);
}
}
}
...