Skip to Content
avatar image
Former Member

Getting dropdown data from JavaBean to Web Dynpro

Hi,

I am getting data as Map in Command Bean from the EJB for the dropdown list box to display as Key/Value pair. I want to set that data to the dropdown field which is in Web Dynpro. I couldn't find how to set the propeties after importing model class into Web Dynpro.

Please let me know if any body knows this solution.

Tats

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 29, 2006 at 03:57 PM

    Hi,

    Try with this code. First get the MAP from Model and set individual value programmatically to Drop DownByKey in the below way.

    //contextElement.empCode - Drop Down Mapped Context Value

    IContextElement contextElement = wdContext.currentContextElement();

    IWDNodeInfo nodeInfo = wdContext.getNodeInfo();

    IWDAttributeInfo dateAttributeInfo = nodeInfo.getAttribute(contextElement.empCode);

    IModifiableSimpleValueSet dropValueSet = dateAttributeInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();

    String empCodeTxt=null;

    //Gives the Size of the List, which is coming from Model

    int nodeLength = wdContext.nodeResult().size();

    for (int i = 0; i < nodeLength; i++) {

    // Gives the Value, Which you want to show in Drop Down List Box.. Change it according to your need.

    empCodeTxt= wdContext.nodeResultNode().get<Parameter>());

    dropValueSet.put(empCodeTxt, empCodeTxt);

    }

    Regards,

    Sridhar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 29, 2006 at 05:54 PM

    There are two flavors of drop-down lists: DropDownByKey and DropDownByIndex.

    In the ByKey variant, you have to provide a DDIC type with a value set that contains the key/value pairs. The drop-down list is then bound against a context attribute of that type.

    In the ByIndex variant, you have to provide a context node with elements storing the values, the selection is given by the nodes's lead selection and you have to determine the key from this index.

    Have a look at both variants and decide what's easier to use in your application.

    Armin

    Add comment
    10|10000 characters needed characters exceeded