on 01-02-2015 5:40 AM
Hi Experts,
How to remove duplicate entries from dropdownlist in web dynpro java? Can someone please help me
I have maintained the data in the z table wherein the records of particular fields are repeated but when i show that record in the Web Dynpro application dropdown list, the user should only be able to view the unique data for selection of that particular field.
Hi Preetam,
I think, you can use your java skills for this. You can follow any of the way as mentioned below
1. Keep all the String values into ArrayList and put a loop to find out the duplicate values and delete.
2. With less code for removing repeated string is to add ArrayList to a Set (as it will not allow duplicates) and then add the Set back to ArrayList
ArrayList hamArrList = new ArrayList();
/* Add all the data to hamArrList */
HashSet hamHSet = new HashSet();
hamHSet.addAll(hamArrList);
/* To clear ArrayList'd data */
hamArrList.clear();
/* Now add the Set back to ArrayList */
hamArrList.add(hamHSet);
Thanks,
Hamendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.