Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8644

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

$
0
0

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?

er1.pnger2.pnger3.png

 

 

 

Regards,

Amala Suganya


Viewing all articles
Browse latest Browse all 8644

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>