cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Drop Down

Former Member
0 Kudos

Hi,

I have a req that I should display Dynamic Drop Down Box for a single input field on th output. I have 3 Car names are there in the selection. If I select one of the selections then it should again displayed as a Drop Down

in which 2 names(price,color) are displyed.

I completed First part, while selecting the car names Iam unable to get Drop Down(2 names) for the seleted car names.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

try this,

Create one static node name like 'NodeA'

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

Private<ViewName>.INodeAElement ele = wdContext.createNodeAElement();

wdContext.nodeNodeA().addElement(ele);

IWDNodeInfo multipleinfo = wdContext.nodeNodeA().getNodeInfo();

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;

//determine the number of entries in dropdown say size

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

elem1 = node1.createElement();

elem1.setAttributeValue("roles",assign the values you want to list);

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

Regards,

Saravanan K

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi,

Import the project and see the complete code for Dynamic UI elements:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/business_packages/a1-8...

Regards, Suresh KB

Former Member
0 Kudos

Hi

See this Thread

Kind Regards

Mukesh