cancel
Showing results for 
Search instead for 
Did you mean: 

How to get selected description of a radioButtonGroupByKey

Former Member
0 Kudos

Hi,

I have created a simple type dureeProlongation with enumeration values:

- value: p1 -> description: duree1

- value: p2 -> description: duree2

- value: p3 -> description: duree3

I would like to retreive the key text when the user selects one entry. For example if the user click on the second radio button, then I would like to be able to store the description entry in a String.

Right now I am only able to retreive the selected radio button value, not the description text.

I am using:

IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();

String value1 = wdContext.currentContextElement().getDureeProlongation();
String value2 = textAccessor.getText(wdContext.currentContextElement().getDureeProlongation());

value 1 = p2 and value 2 = message.p2

What should I do to get the description message and store it in value1 or value2 ?

Thanks in advance for your help.

Thibault

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Thibault,

You can get the discription by this way.

String value1 = wdContext.currentContextElement().getDureeProlongation();

IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute("dureeProlongation");

ISimpleValueSet valueset = attInfo.getModifiableSimpleType().getSVServices().getValues();

if(valueset.containsKey(value1)){

String value2 = valueset.getText(value1);

}

Regards

Ravindra

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Thibault,

I think you can get the Description via the ModifiableSimpleType of the context node.

But that is just a wild guess.

Kind regards,

Matthias