cancel
Showing results for 
Search instead for 
Did you mean: 

When do you Use Dropdown by Index and Key

Former Member
0 Kudos

Hi All,

I would like to know when do you Use DropDown by key and Index UI elements.

Thanks,

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

Drop down bykey is normally used when the drop down data comes from a local dictionary u defined in the application means if you have the values with you which you can directly assign to the dropdown.

Drop down by index in case the data is populated say from a BAPI call means if the values are coming from some diffrent function call etc

Regards

Amit Verma

Former Member
0 Kudos

Hi

As suggested by others, the

DD by Key is used for the simple types

DD by Index is used for nodes having 1:N or 0:N cardinality.

Thanks

Srikant

Former Member
0 Kudos

sorry for something wrong that i suggested in my reply..i just realised after psoting my reply..

actually context node is used in DDOwn by index..not for DDOWN by key...for DDown by key..a simple Context Attribute will work..just make its type as the data type u created.

sorry for the mistake i made earlier.

Former Member
0 Kudos

Hi,

I have a Scenario like this

UI Element( Dropdownby Index/Key) with dropdown fields such as Create, Change and Display. if choose DDby Key how can i implement this if i select on DDbyIndex how to go ahead.

Requirement is how to select Create/Change/Display in each case ( Dropdownby Index/Key). which one is easier if some one gives steps with sample code it will b ehelpfull to me.

on the otherhand if select any one of the Create/Change/Display according to the selected one i should be abel to send the input data from other input fields to BAPI.

Thanks in Advance

Murali

Former Member
0 Kudos

First, I would not use a drop-down list as a menu. The next Web Dynpro release has a button with associated menu (ToolBarButtonChoice) for this purpose.

If using a drop-down list for selecting the action, I would use an additional button to trigger the action.

First you have to populate the drop-down list with your 3 items:

Node "Actions", cardinality 0:N, attribute "Text" : string.

static final String[] ACTIONS = {"Create", "Change", "Display"};

for (int k = 0; k < ACTIONS.length; ++k)
{
  IActionsElement action = wdContext.nodeActions().createActionsElement();
  wdContext.nodeActions().addElement(action);
  action.setText(ACTIONS[k]);
}

Now add a DropDownByIndex to your view and bind the "texts" property to attribute "Actions.Text".

Add a button and an action "Execute", in the action handler get the current selection and do whatever. The currently selected action is the lead selection of node "Actions".

Armin

Former Member
0 Kudos

This is fine adding into DDby index,

if user selects say Display, on Dispaly selection i have to pull data from Bapi and display in wendynpro UI, ( i don't have any other button so that i can assign an action)

how to get which one user selected ...

in which version of NWDS oolBarButtonChoice UI will be available currently i am using NWDS SP14.

Former Member
0 Kudos

Can't you add the button to call the RFC? If not, you could use the "onSelect" action of the drop-down list, but as already said, to me, a drop-down list is a selection widget and not a menu. In the "onSelect" action handler, simply ask for the "Actions" node lead selection to get the selected index.

ToolBarButtonChoice is not available in NW04, but starting with NW04s.

Armin

Former Member
0 Kudos

hi murali,

"Dropdown by Key" is used when u want to use data dictionary type.For this creat a dictionary of simple type in the dictionary.

Ur project>dictionaries>Data Types-->Simple Types right click and make a simple type dictionaty.now open that and click on <b>"enumeration"</b> tab at the bottom of the same.Now ADD the value and text to be displayed.

These simple type dictionaries can be used for DDown by Key.make a contextnode and attribute inside that and edit the type to the dictionary type. now u just have to write a few lines of code for that creating one element and adding that to the node. i hope u know that...if u need that small code tell me..

and DDown by key index can be used while we have to get the data from the database.

In short DDown by key provides static data in DDown and DDOWN by Index makes it dynamic.

please let me know if i have approached ur doubt.

Former Member
0 Kudos

ByKey: You have a DDIC type with a value set

ByIndex: You have a context node with cardinality 0:N

In a table: if you want to have different drop-down lists per table row, you cannot use *ByKey because the attribute type is the same for every row.

Armin