cancel
Showing results for 
Search instead for 
Did you mean: 

default values in dropdown by key

Former Member
0 Kudos

Hi

i have populated some values(hyderabd,chennai,mumabi..) in to dropdownby key using simple type..now i want to set a default value..to dropdownby key,let default value be chennai.can you please tell how to set the default value.

Thanks

Rahul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rahul,

If you have created a value attribute say city(of type simple type you have created and enumerated) and binded it to the DropDownByKey UI Element,

then in the doInit() method give the following code,

> wdContext.currentContextElement().setCity("C"); /* if C is the Key for city Chennai in the enumeration simple type , then chennai will be default value .*/

Regards,

Sam Charles J.

Answers (3)

Answers (3)

Former Member
0 Kudos

HI

for populating values you provide the values in dic - . simple type .

in the emuneration you provide value and text . EX; value 1 text mumbai

in the init() method

wdcontext.currentcontextelement.set<attr>(1);

Edited by: murali krishna reddy on Feb 17, 2009 8:13 AM

Former Member
0 Kudos

Hi Rahul,

to set the default value of your required value write the code as

wdcontext.node<nodename>.setleadselection("2");

Regards,

Shilpa

Former Member
0 Kudos

Hii,

Suppose ur dropdown key is bound to node ---city..and value attribute City1..then put this code in wdDoInit() of view as ;

wdContext.nodeCity().currentCity1Element.setCity("Chennai');

so that Chennai will be set as default value.