Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

sap.m.Select, aggregation without default value

When using a data aggregation on sap.m.Select, the first entry is always selected. Here's a link to the SDK's preview.

Example code from my app

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 called selectedKey on the constructor to change this to another index. What I want is the select to be blank, because I want to force my users to make a choice, not blindly accept the first entry in the list.

I could force a blank entry in my aggregation data>/trip/names but that would pollute my list.

Is there a better way to achieve this?

Former Member
Not what you were looking for? View more on this topic or Ask a question