cancel
Showing results for 
Search instead for 
Did you mean: 

select a value in a drop down

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi suresh,

Use this link

Regards,

karthik.