cancel
Showing results for 
Search instead for 
Did you mean: 

text for drop down by key

Former Member
0 Kudos

Hello

How could I access the text for a drop down by key?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi georgeta,

You can get the text of the drop downbykey by using getText() method of IModifiableSimpleValueSet object.

try this sample code in the event handler of ur dropdown by keyselect.

IWDAttributeInfo attributeInfo2 = wdContext.getNodeInfo().getAttribute(<attribute name>);

IModifiableSimpleValueSet set = attributeInfo2.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();

String text=set.getText(<keyvalue>);

hope it helps for u

With Regards

Naidu

Former Member
0 Kudos

Hi Balaram,

I hav one doubt regarding tex of DDK.

My requirement is like:I need to dispaly the selected dropdown in the next Prj.

I hav to prj lik:Creation ,modification

In creation i hav to choos one value from the DDk and i need to display the same in modification.

But,Instead of getting text i am getting Key in the Modification.

Plz help me out in this......

Regards,

Lavanya.G

Former Member
0 Kudos

Lavanya:

If you're using a simple type for your DDK, you could check the option for generating the class representation for the enum. That way, you could create the simple type from the value (from the context or a DB)

That is, when you're loading the values for the view's context, you can do it by creating an instance of the class that represents your simple type


MyEnumClass nodeVal = MyEnumClass.valueOf(key);
wdContext.currentContextElement().setMyValue(nodeVal);

Hope this helps

Answers (1)

Answers (1)

Former Member
0 Kudos

name1 is one string attribute where we r storing required value........

Sample code for getting the key of the message from its message text.

Field keys[] = IMessage<compname>.class.getFields();

String keyname = "";

for(int index=0;index<keys.length;index++)

{

keyname = keys[index].getName();

IWDTextAccessor ta = wdComponentAPI.getTextAccessor();

if(ta.getText(keyvalue).equals(wdcontext.currentcontextelement.<drope down attribute>))

{

wdcontext.currentcontextelement.setname1(keyname);

}

}

ur ans is in name1

Former Member
0 Kudos

Hi,

I found the solution by hardcoding.

Thanxs a lot