在 Fiori 母版详细信息页面中隐藏批准/拒绝按钮 [英] Hide Approve/Reject Buttons in Fiori Master Details Page

查看:44
本文介绍了在 Fiori 母版详细信息页面中隐藏批准/拒绝按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望根据某些过滤条件在 Fiori 应用程序的详细信息页面中隐藏批准/拒绝按钮.过滤器通过视图/控制器扩展添加到主列表视图(左侧视图)中.现在,如果用户选择某种类型的过滤器(比方说,过去的订单) - 那么批准/拒绝按钮不应显示在订单详细信息页面中.这就是我在 Header/Details 视图中定义按钮的方式

I am looking to hide the Approve/Reject Buttons in the Details Page of a Fiori App based on certain filter conditions. The filters are added in the Master List view (Left hand side view) thru the view/controller extension. Now, if the user selects certain type of filter ( Lets say, Past Orders) - then the approve/reject button should not be displayed in the Order Details Page. This is how I have defined the buttons in the Header/Details view

 this.oHeaderFooterOptions = {
                       oPositiveAction: {                       
                        sI18nBtnTxt: that.resourceBundle.getText("XBUT_APPROVE"),
                        id :"btn_approve",
                        onBtnPressed: jQuery.proxy(that.handleApprove, that)
                       },

                   oNegativeAction: {                   
                    sI18nBtnTxt: that.resourceBundle.getText("XBUT_REJECT"),
                    id :"btn_reject",
                    onBtnPressed: jQuery.proxy(that.handleReject, that)
                   },

但是在运行时,这些按钮没有分配我提到的 ID,而是使用 __button0 和 __button1 的 ID 创建的.

However at runtime, these buttons are not assigned the IDs I mentioned, instead they are created with IDs of __button0 and __button1.

有没有办法从主列表视图中隐藏这些按钮?

Is there a way to hide these buttons from the Master List View?

谢谢.

推荐答案

推荐:SAP Fiori 设计原则只讨论禁用页脚按钮,而不是更改 Button可见性.在此处阅读有关指南的更多信息

Recommended: SAP Fiori design principles only talk about disabling the Footer Buttons instead of changing the visibility of the Button. Read More here about Guidelines

根据过滤条件,您可以像这样禁用:

Based on filter conditions, you can disable like this:

this.setBtnEnabled("btn_approve", false);

再次启用:this.setBtnEnabled("btn_approve", true);

同样,您可以使用 this.setBtnText("btn_approve", "buttonText");

其他方式:正如@TobiasOetzel所说的使用

this.setHeaderFooterOptions(yourModifiedHeaderFooterOptions);

这篇关于在 Fiori 母版详细信息页面中隐藏批准/拒绝按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆