Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.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
SAPUI5弹出对话框按钮动态可见性_Sapui5 - Fatal编程技术网

SAPUI5弹出对话框按钮动态可见性

SAPUI5弹出对话框按钮动态可见性,sapui5,Sapui5,我有一个SAPUI5弹出对话框,在弹出窗口的页脚部分有几个按钮 我需要根据模型属性的值动态设置弹出窗口中按钮的可见性。有没有办法做到这一点 that.oNewAppointmentDialog = new Dialog({ title: "{i18n>CreatePopupTitle}", content: [ sap.ui.xmlfragment("Create

我有一个SAPUI5弹出对话框,在弹出窗口的页脚部分有几个按钮

我需要根据模型属性的值动态设置弹出窗口中按钮的可见性。有没有办法做到这一点

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);
      }
    }
  }
...