When using data aggregation sap.m.Select, the first record is always selected. Here is a link to preview the SDK .
Sample code from my application
new sap.m.Select("id-names", {
width: '100%',
}).bindAggregation("items", "data>/trip/names", new sap.ui.core.Item({
text: "{data>Name}"
}));
There is a parameter in the constructor selectedKeyto change it to another index. I want the choice to be empty , because I want to force my users to make a choice, and not accept the first entry in the list.
I can force an empty entry in my aggregation data>/trip/names, but that could pollute my list.
Is there a better way to achieve this?
source
share