cancel
Showing results for 
Search instead for 
Did you mean: 

get an enumeration value (not a description) of Simple type

Former Member
0 Kudos

Hi,all

How can I get an enumeration value (not a description) of Simple type that I have created?

Regards,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

ThatSAPGuy
Advisor
Advisor
0 Kudos

Michael-

I am not sure if I understood your question. Are you saying that you have created a simple type with some key value pairs and

1. you want to access these values at runtime?

2. you have created a drop down and want to know which key the user has selected

3. do something else

Cheers-

Atul

Former Member
0 Kudos

Hi,Atul

the second case...

Thanks,

Michael

ThatSAPGuy
Advisor
Advisor
0 Kudos

Michael-

Here is how you do it:

1. Create an attribute of the Simple Type you have created in your controller context.

2. Insert a DropDownByKey in your view.

3. Create a data binding between the attribute and the selectedKey property of the drop down list.

4. To get the key of the selected value use the following code in your controller:


String key = wdContext.currentContextElement().get_AttributeName_();

Where AttributeName is the name of the attribute you have created in step 1.

Cheers-

Atul

Answers (0)