cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the corresponding Text for the key in DropDownByKey UIElement

Former Member
0 Kudos

Hi Experts,

I need the code for getting the corresponding Text for the key in DropDownByKey UIElement.

Regards,

Priya

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Say your DropDownByKey.<i>selectedKey </i>property is bound to an attribute "Name" in a node "Employees".

Then you can access the value set of the DDIC type of that attribute and get the text for any key like this:

IWDAttributeInfo att = wdContext.nodeEmployees().getNodeInfo().getAttribute(IEmployeesElement.NAME);
ISimpleValueSet valueSet = att.getSimpleType().getSVServices().getValues();
String text = valueSet.getText("key");

Armin

Former Member
0 Kudos

Hi

Your Key is X And Value is Text, To show the Value and store the Key as invisible,

Create a Simple type in Dictionary and add enumeration values ..

In context create a value attribute and change it's type in properties to newly created simple type....

Now bind the dropdownbykey selected key to the value attribute .

Get the current Keyvalue as wdContext.Current<Drop>Element.get<Attribute>;

Sunitha

Former Member
0 Kudos

Hi Sunitha,

I m getting the values in the dropdownkey from backend i.e Sol Manager.

So how can i get the Text for the key?

Regards,

Priya

Former Member
0 Kudos

Hi ,

Dropdown by Index gets value from node.There is no key-value pair. We can load the values to it from a context node.

<b>DropDownByKey</b>: used when we use data dictionary type.For this create a dictionary of simple type in the dictionary.

<b>DropDownByIndex</b>: used when we get the data from the database. Here we directly bind the DropDownByIndex UI element to the context node(attribute).

Thanks,

Sunitha