Skip to Content
author's profile photo Former Member
Former Member

Dynamically population for DropDownByKey

Hello folks,

Does someone know how to fill DropDownByKey component dynamically, i.e. how to fill it without entering static values. I would like to use Simple Value Selector that I fill by calling some RFC and not by static population of Value, Description pair. Thanks in advance.

Kind Regards,

Aleksandar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2007 at 02:32 PM

    HI,

    Create a value attribute(Say DDValue) of type string and bind it to value property of DDByKey.

    Then after calling RFC, do the following

    IWDAttributeInfo att=wdContext.getNodeInfo().getAttribute(IPrivate<ViewName>View.IContextElement.DDValue);

    ISimpleTypeModifiable ss=att.getModifiableSimpleType();

    IModifiableSimpleValueSet sss=ss.getSVServices().getModifiableSimpleValueSet();

    for(int i=0;i<rfcMasterNode.size();i++)

    {

    rfcEl=rfcMasterNode.getrfcMasterElementAt(i);

    sss.put(""+rfcEl.getKeyattrib(),rfcEl.getValueAttrib());//PUTTING KEY AND VALUE FROM RFC Node

    }

    Regards

    Fahad Hansa

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      You can use DropDownByIndex(DDBI) also for your key,Description pair,

      provided that a single node has both key,Value as attributes.

      From your model node map the attribute that you want to display as

      description in the DropDown with the texts property of DropDownByIndex.

      After the value is slelected in the drop down get the key value as

      wdContext.current<Node>Element.getKey();

      This will return you the key of the selected description.

      Say,

      Context

      + Product (RFC node)

      ---ProductID (key attribute)

      ---ProductName (description attribute)

      Map the attribute ProductName with the texts property of the DDBI.

      Thats all.No coding nothing.

      In the action where you want the key of the selected value

      wdContext.currentProductElement.getProductID();

      try this and let me know

  • Posted on Jul 03, 2007 at 02:43 PM

    Hope your problem is solved. right?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2007 at 06:43 AM

    Hai ,

    You use DDBK when you are going to display static data like countries, states..

    better to use DDBIndex for Dynamic values

    context

    |-AA

    |-a

    bind a to DDBI

    String arr[]={"a","b","c"};
    for(int i=0;i<arr.length;i++){
    IPrivateXXView.IAAElement ele=wdContext.createAAElement();// here AA is the node 
    ele.setA(arr<i>);
    wdContext.nodeAA().addElement(ele);
    
    }

    Regards,

    Naga

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 03, 2007 at 02:55 PM

    Hi,

    If you dont want "drop down by Key", You can take "drop down by index" for this you just need to map the drop down by index to your model nodes attribute.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.