如何将多输入的valueHelpOnly属性与n-more功能一起使用

时间:2019-03-21 10:23:35

标签: sapui5

如果将valueHelpOnly设置为true,则无法再按“ n更多”按钮。 tokens超出显示数量时,将弹出“ n更多”按钮。
如果您尝试按下按钮,则会弹出值帮助。

有人知道如何同时启用两个功能吗?

enter image description here

我的xml控件:

<MultiInput
    id="idInput"
    showValueHelp="true"
    valueHelpOnly="true"
    valueHelpRequest="onVHD"/>

我的控制器:

onVHD: function() {
    this._oVHD.open();
},

onVHDCancel: function() {
    var aItems = [];
    aItems = this.getView().byId("idVHDList").getSelectedItems();
    for (var i = 0; i < aItems.length; i++) {
        aItems[i].setSelected(false);
    }

    this._oChannelVHD.close();
},


onVHDConfrim: function(oEvent) {
    var aItems, item, input, sId, aTokens = [], bDouble = false;

    aItems = this.getView().byId("idVHDList").getSelectedItems();
    input = this.getView().byId("idInput");
    aTokens = input.getTokens();

    for (var i = 0; i < aItems.length; i++) {
        item = aItems[i];
        sId = "__" + item.getTitle();
        bDouble = false;
        for (var j = 0; j < aTokens.length; j++) {
            if (aTokens[j].sId === sId) {
                bDouble = true;
            }
        }
        if (bDouble !== true){
            input.addToken(
                   new Token(sId,{
                    text: item.getDescription(),
                    key: item.getTitle()
                   }
            ));
        }

    }

    this.onChannelVHDCancel();

},

我的对话框

<core:FragmentDefinition
    xmlns="sap.m"
    xmlns:core="sap.ui.core">

<Dialog title="{i18n>vhd.title}">
    <content>
        <VBox>
            <SearchField
                liveChange="onSearchVHD"
                width="100%" />

            <List
                id="idList"
                items="{remote>/CCCSet}"
                mode="MultiSelect">
                <StandardListItem
                    type="Active"
                    press="onList"
                    title="{remote>XXX}"
                    description="{remote>YYY}"/>
            </List>
        </VBox>
    </content>
    <beginButton>
        <Button
            text="{i18n>vhd.beginButton}"
            press="onVHDConfrim" />
    </beginButton>
    <endButton>
        <Button
            text="{i18n>vhd.endButton}"
            press="onVHDCancel" />
    </endButton>

</Dialog>

</core:FragmentDefinition>

0 个答案:

没有答案