Skip to Content
author's profile photo Former Member
Former Member

text for drop down by key

Hello

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

Thank you

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2006 at 03:40 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2007 at 03:46 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.