cancel
Showing results for 
Search instead for 
Did you mean: 

populating values int odropdown by indext from model

Former Member
0 Kudos

Hi

can you please tell me how to populate values in to dropdown by index from model(backend)

Thnaks

rahul

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Rahul,

Welcome to SDN!

Not much needed for this. Just create a table with two fields key and value in the RFC and popualte values in it. Bind the texts property of the DDI to the value attribute of the table.

Remember you will have to use table under the Output node.

To get currently slected key,

you can use this code.

wdContext.current<DDItable>Element().get<key>();

Regards,

Siva

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

just bind the "texts" property of the DropDownByIndex with the attribute of the output node the rfc have.

execute the rfc in Doinit method of the view.

Regards,

ramesh

Former Member
0 Kudos

Hi Rahul,

You can do it by using slightly different method also.

Below is the code given.

IPrivateInbevecc_compView1.IVn_PlantElement plantElement = null;
  for(int i=0;i<arrayList.size;i++){
plantElement = wdContext.nodeVn_Plant().createVn_PlantElement();
				plantElement.setVa_Plant(arrayList.get(i).toString());
			wdContext.nodeVn_Plant().addElement (plantElement);
}

Regards

Narendra

Former Member
0 Kudos

Hi Rahul,

Take the output from backend in a arrayList. Now use the below code to populate the drop down.

I have created a node of name node Vn_Plant and its attribute as Va_Plant

IPrivateInbevecc_compView1.IVn_PlantElement plantElement = null;
  ArrayList testList = new ArrayList();
for(int i=0;i<arrayList.size;i++){
plantElement = wdContext.nodeVn_Plant().createVn_PlantElement();
				plantElement.setVa_Plant(arrayList.get(i).toString());
				testList .add(plantElement);
			}
			wdContext.nodeVn_Plant().bind(testList );

Please revert if you require more info.

Regards

Narendra