Search code examples
sapui5sap-fiori

Unable to suggest all values in sap.m.Input


I have implemented assisted sap.m.Input control in my project. I also have a value help request for the same. The binding is from an OData service.

The issue is when I type in values in the control, not all values are suggested. But if I search (filter in the liveChange method) in the value help dialog, I can find the desired value.

Is there some property to be set to the suggestion values in the Input control, to fetch all possible values from the OData service?

<Input id="idInputControl" showValueHelp="true" valueHelpRequest="onValueHelp" showSuggestion="true" suggestionItems="{/results}">
    <suggestionItems>
        <core:ListItem text="{someproperty}" additionalText="{someproperty}"/>
    </suggestionItems>
</Input>

This is my Input control code. I have set the data in onInit function. In the onInit function, I am able to fetch the entire data which is set to the Input control. But on typing values, only some are suggested.

Kindly assist.


Solution

  • The model has a length limit of 100 elements. If you want to fetch more values in your model you can increase its size limit with the setSizeLimit function (quick and dirty solution) or (much better) use the dynamic suggestion implementing the suggest event callback of the input.

    Here in the API reference you can find a nice example of this second approach.