on 09-28-2005 7:54 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.