将项目从自定义控件连接到包装的Multicombobox控件UI5

问题描述 投票:0回答:1

我想拥有一个类似XML的自定义控件

<xx:TokenizedMultiComboBox
    items="{
            path: 'filterModel>/allDiseases',
            sorter: { path: 'text' }
    }"
    selectedKeys="{selectedItems>/disease}"
>

但是在我的JS代码中,我想将itemsselectedKeys传递给真正的MultiComboBox。在UI5中有可能吗?

Control.extend('drex.control.TokenizedMultiComboBox', {
    metadata: {
      properties: {
        // get Items binding here
      },
      aggregations: {
        _combo: { type: 'sap.m.MultiComboBox', multiple: false },
      },
      events: {}
    },
    init: function() {
        // smth like 
        this.get_combo.setBinding('items');
    }
}

javascript sap sapui5
1个回答
0
投票
是的,您可以在自定义控件上定义聚合并将其转发给真实控件。
© www.soinside.com 2019 - 2024. All rights reserved.