sap.m.Select : selectedKey Attribute not working with dynamic Content in a view.xml
I have a view.xml with a sap.m.List wrapped around multiple sap.m.HBox-es. Inside such an HBox is a sap.m.Select element with the attribute selectedKey set. If the content of the List is loaded by binding to a model (in this case to a json object) then the Select does not preselect the key according to selectedKey. The model is rendered correctly if set. If no json object is set, the selectedKey of the Select works. In both cases a static string is used as a key (but with the intention to use an attribute of the json object later on).
(I also tried two ways to provide the json object. Unfortunatly only the one with dynamic loading with sap.ui.model.json.JSONModel.loadData() works but not .setData(). - But that is another issue.)
For further investigation we need a sample to debug. Could you please provide jsbin sample http://jsbin.com/fowiciciho/1/edit?html,js,output
I tried to reproduce the code as closely as possible without too much overhead. http://jsbin.com/kopanemube/edit?html,output Unfortunatly in the jsbin-application I have to use a string to represent the xml-view-code. This somehow breaks even more because now not even the selects items are complete (just one is shown). This has to be some other issue. However if I run the same code on a local test-application with a Test.view.xml and a Test.controller.js (renaming the controller in the code as well) then everything works fine regarding showing all items from the select. However, still the defined item of the select is not automatically preselected because it is dynamically created as part of the List. If it is not part of the List then everything works as expected (Item Text is preselected instead of Number).
Thanks for the jsbin. Internal incident 1580183712 has been created for this issue.
Unfortunatly in the jsbin-application I have to use a string to represent the xml-view-code. This somehow breaks even more because now not even the selects items are complete (just one is shown). This has to be some other issue.
@v-schulz Thanks for the ticket. This is because in the bootstrap the sap.m library was missing.