cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Dropdown Creation-Problem

Former Member
0 Kudos

Hi

I am new to Dynpro. Anybody tell how to create DropdownByIndex. Please help me.

Thanks,

Peter.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi peter,

Please use the following steps.

Create one Node using the following code. Inside the DoInit() method

Step 1:

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

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

Step 2:

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);

}

Step 3:

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");

Finally add this Dropdown into container. Like this you can create more Dropdown and add action to the dropdown as dynamically.

<b>if valuable answer=points</b>

Kind Regards,

S.Saravanan.

Message was edited by: Saravanan S

Former Member
0 Kudos

Hi Saraanan,

Thanks lot for you. I have solved my problem. Once again thank you verymuch.

Thanks,

Peter.

Answers (0)