Skip to Content
0
Former Member
Jul 04, 2014 at 07:13 AM

Getting extra copies of list item in a drop-down box.

16 Views

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

Attachments

er1.png (22.3 kB)
er2.png (25.3 kB)
er3.png (25.4 kB)