Skip to Content
avatar image
Former Member

Setting Default values in Dynamically created dropdown by key

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 29, 2008 at 06:56 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 30, 2008 at 04:31 AM

    Hi,

    if you want to select the default value as 1.

    use this

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

    Regards,

    ramesh.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 30, 2008 at 05:27 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded