Skip to Content
avatar image
Former Member

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

Hi,all

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

Regards,

Michael

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Feb 20, 2008 at 04:59 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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