cancel
Showing results for 
Search instead for 
Did you mean: 

SimpleValueType and DropDownByKey-Element

Former Member
0 Kudos

Hi,

I have an SimpleType. This i bound to a context-attribute.

I get the selection with this code:


selection = wdContext.currentContextElement().getAttributeAsText("MyAttribute");
// selection = wdContext.currentContextElement().getMyAttribute();

How can i get the description?

Greetings

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Thomas,

Yu can get the current selection by the statement:

String selected_key = wdContext.currentContextElement().get<your_attribute_name>();

This will return you key value;

To get the corresponding text for the key, use the following code:

String attributeName = IPrivate<your_view>View.IContextElement.<your_simpletype_attribute>;

IWDAttributeInfo attributeInfo = wdThis.wdGetContext().getNodeInfo().getAttribute(attributeName);

ISimpleType simpleType = attributeInfo.getSimpleType();

ISimpleValueSet valueset = simpleType.getSVServices().getValues();

if(null!=selected_key)

String text_value = valueset.getText(selected_key);

'text_value' will have the corresponding text.

Hope this helps you,

Best Regards,

Nibu.

Former Member
0 Kudos

Problem solved. Thanks.

Answers (0)