cancel
Showing results for 
Search instead for 
Did you mean: 

Removing duplicate entries from dropdownlist in web dynpro java

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

govardan_raj
Contributor
0 Kudos

Hi Preetam,

removing duplication entries from  drop down list - here you can do one thing concatenate key with description and display the same , so that dropdown list wil have unique values .

Regards

Govardan Raj S

Former Member
0 Kudos

Hi Govardan,

Can you please tell me what you said with an example?

Request your help on this

Thanks,

Preetam

govardan_raj
Contributor
0 Kudos

hi preetam ,

in the drop down list if it is dropdown by key UI element , then we have key-description pari values and as shown below

 

 

IWDAttributeInfo *******Modeattrinfo = wdContext.nodeChn*****InputNode().getNodeInfo().getAttribute(IPublic******Comp.IChn*****InputNodeElement.*****_MODE);

ISimpleTypeModifiable *******ModeModifiableSimpletype = *******Modeattrinfo.getModifiableSimpleType();

IModifiableSimpleValueSet *******ModeSimpleValueSet = *******ModeModifiableSimpletype.getSVServices().getModifiableSimpleValueSet();

*******ModeSimpleValueSet.clear();

*******ModeSimpleValueSet.put(M******thConstant.KEY_VALUE,M******thConstant.KEY_VALUE+

"-"+M*******hConstant.DESC);

here in the value set you can see that we are concatenating the description along with the key and key value is unique always.

can u please specifiy what UI element you are using , like Drop down by index or drop down by key and in the ui which feild fo the z table you are displaying ......?

if the records the z table are repeated , then in the table there should be a key attribute , try to concatenate that with the field displayed in the Drop down list UI elelment of your screen so that end user can identify that.

Regards

Govardan Raj

Former Member
0 Kudos

Hi Govardan,

I am using Drop Down by index as the UI element. following is somethingsimilar to the ztable:-

   A               B               C         

11256          VID          911256   

11256          VID          811256

11256          SONY      11256

'A' field is the primary key. We are fetching all the 'B' fields in the dropdownlist for every 'C' field i.e corresponding to every 'C' field. But we want only unique values in dropdown.

Request your help on this.

Thanks,

Preetam Narkhede

govardan_raj
Contributor
0 Kudos

hi preetam ,

as you have specified that A feild is primary key , in that case how come it is having repeated values i.e 11256 in all three rows ?

and here

We are fetching all the 'B' fields in the dropdownlist for every 'C' field i.e corresponding to every 'C' field

Can you please explain the above for every c feild , it is not clear to me ...

Regards

Govardan Raj S

Former Member
0 Kudos

Hi Govardan,

I am sorry i made a mistake. You are right 'A' field is not the primary key. We just need to fetch all the 'B' fields. As i have shown in the table, the VID value is fetched twice in the dropdown because there corresponding 'C' fileds are different.

I want that, in the dropdownlist these values should not be repeated.

govardan_raj
Contributor
0 Kudos

in this case just combine B + C , i.e create on more attribute with name as BC in the local node to which the data from z table is filled, now whiel filling

setBC(value of B +" - " + value of C) ; this should solve the problem .

Regards

Govardan

Former Member
0 Kudos

Hi Govardan,

The entire table which I told you is a ztable. And I am new to this so I did not get what exactly you are trying to explain. can you please explain me this in detail.

Thanks,

Preetam Narkhede

govardan_raj
Contributor
0 Kudos

HI Preetam,

i understand that data is in z table , but on executing the rfc you are getting this data in model node and then from model node you set the contents to the local node  which is binded to the drop down by index UI element , while setting contents from model node to local node concatenate the values of b feild and c feild and set it to the same attribute to which you were setting the value of b .

still you have doubts please post will help you out ... further in detail with screen shots need not worry as you are new to this

Regards

Govardan Raj S


Former Member
0 Kudos

Thanks Govardan for your valuable answers.

We implemented Hashsets in this case and that problem is solved.

Thanks,

Preetam narkhede

junwu
Active Contributor
0 Kudos

why not fix it at source?

Former Member
0 Kudos

Hi,

Check if you can apply java logic to find unique values in the ztable results, before setting it as a reference for Drop Down list.

Former Member
0 Kudos

I searched for the logic but cannot link up with that, as to how I can proceed. Request your help on this.