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

select a value in a drop down

I have a drop down(by Key), and want a specific value from the dropdown values to be selected when the page is loaded.

Please help

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 05:46 AM

    Hi,

    You can write the following line of code in wdDoInit()

    wdContext.currentContextElement().setDropDown("TEST");

    where DropDown is the value attr mapped to the dropDown UI element and

    TEST is the key value of the element which you want to display.

    This will solve your problem.

    thanks & regards,

    Manoj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 05:55 AM

    Hi suresh.

    Try this sample coding..

    String Sample = null;

    IWDAttributeInfo attribInf = wdContext.nodeTable().getNodeInfo().getAttribute("key");

    ISimpleType simpleType = attribInf.getSimpleType();

    Set set = simpleType.getEnumeration();

    Iterator it = set.iterator();

    while(it.hasNext())

    Sample = it.next().toString();

    wdContext.nodeTable().currentTableElement().setKey(Sample);

    GS

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 05:44 AM

    Hi suresh,

    Use this link

    How to select 1st entry in DropDownByKey object

    Regards,

    karthik.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 05:51 AM

    Hi,

    you can use this code to set the default value

    wdcontext.currentcontextelement.setsel_att(<default value>);

    Give the key value u want to set as default.

    Regards,

    karthik.

    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.