cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Default values in Dynamically created dropdown by key

Former Member
0 Kudos

Hi All,

I am creating dropdownBykey Dynamically at runtime.

I am able to create dropdown with range beteen 0 to10.

User can select any value between 0 to 10.

My requirment is to show some * Default value* in dropdown when dropdown are generated at run time.Default value will be

known at *runtime only. *

I am populating all the dropdown with values 0 to 10 using one node which is declared at design time.This values will be same for all dropdowns.

Can someone let me know as to how I can achieve this.

Thanks in advance.

Zaid

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

u can set a default value to a drop down at run time

write this piece of code in the wdDoInit() of the view controller

wdContext.currentContextElement().setObject("2");

here Object is my context attribute.

Regards,

Satya.

Former Member
0 Kudos

Hi,

if you want to select the default value as 1.

use this

wdContext.node<Your Value Node Name>().setLeadSelection(1);

Regards,

ramesh.

Former Member
0 Kudos

Why do you need a node if you are using a DropDownByKey?

For setting the selected key you have to set a value for the context attribute to which the "selectedKey" property is bound. What else?

Armin