cancel
Showing results for 
Search instead for 
Did you mean: 

usage of drop down by key

Former Member
0 Kudos

Hi ,

I am using dropdown by key in a application.we have a bank type drop down which shows blank when we enter to the page on dropping down shows 2values in it , scenario is on creation of new bank account it should show 2values on dropping down and on editing the existing record it should the type of account created by default(on entering page) should be a drop down.

And data to be cleared on navigaton between create and edit.

please help me solving the issue .

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

-

Former Member
0 Kudos

Hi Shrushti.

At design time you want to have 2 default values for the drop down and in the runtime you want to manipulate this values and replace with new one.

At run time you can fill dropdown by new values, for this you have to create elements for the node you are using for the drop down.

Please refer the below sample code:-

ISimpleType simpleType = wdContext .nodeProjEstiTable().getNodeInfo().getAttribute("projphasname") .getModifiableSimpleType();

IModifiableSimpleValueSet svs1 =simpleType.getSVServices().getModifiableSimpleValueSet();

svs1.clear();

for (int j = 0; j < projphasname.length; j++) {

svs1.put(projphasname[j][1], projphasname[j][1]);

}

Mean while for data to be cleared on navigation between create and edit. , you can invalidate context node you haev created for the drop down based on the logic you have created for create and edit like :-wdcontext.<nodename>.invalidate();.

Be careful once you will use this line data will be gone.

Hope this may help you.

Deepak!!!

Former Member
0 Kudos

Hi Deepak ,

Thanks for reply , values in drop down are coming from BAPI , changes depepnding on bank type. it is still possible to use the code provided by you?

please guide.

Former Member
0 Kudos

HI Shrushti,

values in drop down are coming from BAPI , changes depepnding on bank type--->after getting values you have to write your logic as per bank type.

The code which i have posted earlier was related how to add/fill values in the drop down via code. You can utilize this code.

Deepak!!!