I have created a drop-down box in a fragment and on after rendering event i have inserted a list item "select" using the below code in the fragment file.
myDropDownBox.addEventDelegate({
onAfterRendering : function() {
myDropDownBox.insertItem(new sap.ui.core.ListItem({text: "-Select-", key: "None"}),0);
myDropDownBox.setSelectedKey("None");
}
});
In my scenario I have a button and a panel in my view and on each button click i am calling the fragment and add it to the panel content but the issue I am facing is the list item "select" is getting duplicated on each drop down boxes incrementally with the button click.(Kindly Refer the Screen shot that i have attached).Can anyone suggest me a solution to avoid or remove this extra copies?
Regards,
Amala Suganya