cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing a dynamic dropdown list

Former Member
0 Kudos

Hi All,

I am implementing an Adaptive RFC model that uses two custom RFC's. First RFC returns a table that has list of countries and the second RFC returns a table that lists the states of a particular country.

Now using these two RFC's how do I implement a dynamic dropdown...i mean the first dropdown should show the list of countries and the second dropdown should show the list of states depending on the country selected.

Thanks,

Tom

Accepted Solutions (1)

Accepted Solutions (1)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Tom,

On select of first dropdown(country) Action event populate the second dropdown(states).

Regards, Suresh KB

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Tom,

You can use dropdownbyindex for both drop down.

Initially onload populate the country dropdown with RFC values.

using th onSelect event of the dropdown for country call the RFC which gives you the states by passing the country value.

Assign these values to the states dropdown.

I hope this will solve your problem

former_member189631
Active Contributor
0 Kudos

Hi Tom,

Please try this,

IWDNodeInfo multiplenode = multipleinfo.addChild("MultiNode" , null, true, false, true, true, false, true, null, null, null);

multiplenode.addAttribute("roles", "ddic:com.sap.dictionary.string");

Assign values for Dropdown

IWDNode node1 = wdContext.nodeNodeA().getChildNode("MultiNode", IWDNode.NO_SELECTION);

IWDNodeElement elem1;

for(int s=0;s<5;s++){

elem1 = node1.createElement();

elem1.setAttributeValue("roles","Value"+s);

node1.addElement(elem1);

}

Inside Domodifyview create IWDDropDownByIndex UI Element and Bind it.

IWDDropDownByIndex dropDownList = (IWDDropDownByIndex)view.createElement(IWDDropDownByIndex.class, "drop");

IWDAttributeInfo info = wdContext.getNodeInfo().getChild("NodeA").getChild("MultiNode").getAttribute("roles");

dropDownList.bindTexts(info);

dropDownList.setWidth("100");

Regards,

Ramganesan K.