cancel
Showing results for 
Search instead for 
Did you mean: 

Get key from dropdownbyKey UIelement

Former Member
0 Kudos

Hi,

I'm using a dropdownbykey element in my webdynpro view.

I've filled it with a valueSet (key , value);

The dropdown is working perfect, but I'm only able to get the selected value out of the dropdownbox.

wdContext.currentContextElement.getSelectedItem();

Is there a way to get the also the key of the element.

For example:

valueSet (1, "test");

with wdContext.currentContextElement.getSelectedItem(); I'm getting "test"

How do I get the key of this element?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI Van,

Use interface ISimpleValueSet. It has method getKey() and getText().

This will give you both the values.

Regards,

Nikhil

govardan_raj
Contributor
0 Kudos

Hi tim van ,

if you have implemented evs properly , then above code should give the key value , i.e accessing an attribute value for which evs is implemented will fetch the key value .

can u please share the complete code how EVS is implemented

Regards

Govardan

former_member191044
Active Contributor
0 Kudos

What data type returns "getSelectedItem"? Have you created a own SimpleType with enumerations?

Usually you should create a Class representing your SimpleType with enumeration. Then you can access key and value.

Regards

Tobias.