cancel
Showing results for 
Search instead for 
Did you mean: 

how to remove duplicates for sap.m.ComboBox items through xml

muhsin_panakkal
Participant
0 Kudos

Hai Experts,

I am having one sap.m.ComboBox which is loading some data once after made some events, The data is loading is having duplicate values, I know the duplicates can be removed through same js methods, but can anybody help me to do the same through XML..?

Thanks,

Muhsin

junwu
Active Contributor
0 Kudos

what is "through xml"?

xml just define the view, how it can help?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member221786
Active Participant

Hey Muhsin,

there is no way removing duplicates via XML explicitly.

You are only able to filter the items but unfortunately not with something that removes duplicates.

Depending on your model (JSON or OData) you can remove duplicates in your Backend Service (OData) or remove them before setting the data to your Model (JSON)

Hope that helps.

Greetings
Sebastian

former_member227918
Active Contributor
0 Kudos

Hi Muhsin Panakkal,

if you are using odata service, this is design issue, sometimes you wont get duplicate record with test run, but after binding you gets duplicate due to design issue,

in the entity set there is no proper unique key assigned, check the properties of entityset and set the unique key(s) there itself. duplicate value will be avoided.

0 Kudos

var arr = [{ "State": "RWCW"}, { "State": "RSCW"}, { "State": "RWCW"}, { "State": "RSCW"}]; var clean = arr.filter((arr, index, self) => index === self.findIndex((t) => (t.save === arr.save && t.State === arr.State))) console.log(clean);

0 Kudos

You can try this example