gpt4 book ai didi

SAPUI5 获取与绑定(bind)关联的控制

转载 作者:行者123 更新时间:2023-12-01 15:02:53 24 4
gpt4 key购买 nike

我知道我可以通过 control.getBinding('example') 获得与控件关联的绑定(bind)。

有没有像binding.getControl()这样的相反方式?

最佳答案

不确定这是否有帮助,但请查看控件属性“fieldGroupIds”。它用于验证目的,因此您可以调用链接到该特定字段组的所有控件。您可以使用它来识别所有使用该特定绑定(bind)的控件并调用链接到该字段组的所有控件。请参阅以下文档:

Field Groups

访问字段组中的控件:

在某些场景下,需要找到属于特定字段组的所有控件,或者找到具有fieldGroupId 的所有控件。为此,该控件实现了公共(public) getControlsByFieldGroupId 方法,该方法获取应用程序代码中的子控件列表。

var aAllControlsWithFieldGroupId = myVerticalLayout.getControlsByFieldGroupId();              //all where fieldGroupId is not empty 
var aMyGroupControls = myVerticalLayout.getControlsByFieldGroupId("myGroup"); //exact matches to myGroup

与上述类似,您可以将 sap.ui.Core 的 byFieldGroupId 方法用于具有特定字段组 ID 的所有控件。

var aAllControlsWithFieldGroupId = sap.ui.getCore().byFieldGroupId();              //all where fieldGroupId is not empty 
var aMyGroupControls = sap.ui.getCore().byFieldGroupId("MyGroup"); //exact matches to myGroup
var aNotGrouped = sap.ui.getCore().byFieldGroupId([]); //exact empty array (default value of fieldGroupIds)

关于SAPUI5 获取与绑定(bind)关联的控制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54577130/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com