Skip to Content
avatar image
Former Member

Bydefault show the value in DropdownByKey

Hi ,

In table I created DropdownBy Key for values I took SimpleType. The values are showing in dropdown.But I want to show the one value in dropdown by defualt.

Please help me out.

Thanks

Risha

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 23, 2008 at 06:38 AM

    Hi Risha,

    make selection cardinality of ur dropdown's context Value node as 1:1.

    Regards

    Khushboo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2008 at 05:11 AM

    Hi Risha,

    You can set default value like this:

    in wdDoInit()

    wdContext.current<nodename>Element.set<DDattributename>("defaultkey");

    Regards,

    Siva

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2008 at 05:11 AM

    Hi,

    Hi,

    In DoInit() method of View do the following

    if example the DropDownByKey UI is bind with attribute country.

    the country is of simple type Country.

    then by default you can set country you desired using the below statement,

    wdContext.currentContextelement().setCountry("IND");

    here the "IND" is the value and description is INDIA in simple type.

    so in DropDownByKey you can see the INDIA.

    Regards,

    ramesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      use this ,

      public void wdDoInit()

      {

      //@@begin wdDoInit()

      iprivate<ur view name>.ICtx_vn_ItemNode iCtx_vn_ItemNode = wdContext.nodeCtx_vn_Item();

      iprivate<ur view name>.ICtx_vn_ItemElement iCtx_vn_ItemElement =

      iCtx_vn_ItemNode.createCtx_vn_ItemElement();

      iCtx_vn_ItemElement.setItem("abc");

      iCtx_vn_ItemNode.addElement(iCtx_vn_ItemElement);

      iCtx_vn_ItemNode.moveNext();

      // repeat the italic statements to add second row.

      }

      Edited by: Ramesh Babu V on Sep 23, 2008 11:58 AM