Skip to Content
0
Jun 24, 2018 at 03:59 PM

Combo box empty for json list

345 Views

I am trying to get data from backend using Combo Box fuctionality with Json list

I see the drom down but surprisingly empty text ...

Here is my xml

=============================================

<ComboBox id="Country" selectionChange="onSearch"
value="{/comboBoxValue}"
selectedKey="{/comboBoxKey}"
items="{ path:'Country>/Countries' }">
<core:ListItem key="{Countries>key}" text="{Countries>text}"/>
</ComboBox>

==============================================

Here is my .js view

==============================================

var oModel = new JSONModel("countries.json");
oModel.setProperty("/comboBoxValue", "");
oModel.setProperty("/comboBoxKey", "");
this.getView().setModel(oModel,"Country");

},

===============================================

and the .json

===============================================

{
"Countries": [
{
"text":"Austria",
"key":"AT"
},
{
"text":"Belgium",
"key":"BE"
},
{
"text":"Bulgaria",
"key":"BG"
},

{
"text":"United Kingdom",
"key":"GB"
}
]
}

Attach is the screen how for the empty text

what i am missing ?

Thanks,
Chetan.

Attachments