Showing results for 
Search instead for 
Did you mean: 

Insert Texts in DropDownList

Former Member
0 Kudos

Hi Experts,

How can i add values or texts to my dropdownbyindex element.

i need some info ab't it.

Thank U!!

Ravi Aswani

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Aswani,

First create a ValueNode named some ' Emp ' in the Context & take one Attribute named ' Id ' of type String for the node( Emp ) in the Context.

Take the Cardinality Property for the Context Node Emp as 0..n & Selection Property for the Node Emp as 1..1

Take DropDown UI element in the Layout Tab & bind Texts Property of that UI element to context attribute ' Id ' ( Emp.Id )

Now in the Coding Part Take like this

IPrivate<ViewName>.IEmpElement element;

for(int i=0;i<3;i++)


element = wdContext.createEmpElement();

element.setId("Employee Id "+i);



With Regards,

Roop Kumar.

Edited by: Roop kumar Annavarapu on Sep 1, 2008 7:59 AM

Former Member
0 Kudos


theres another way to this go to dictionary-->loacl dictionary -->simple types right click on simple types put in sipmle type name give some valid package name by pressing the browse button.

doble click on the simple type u have created and then go to enumaration tab.

press on new

add the values u want to be displayed in the drop down list

Now in create a context that u are going to map to the texts property in the dropdown by index element.

now change the type of this context elment to the simple type u have created.

Edited by: Nikhil Tapkir on Sep 1, 2008 7:56 AM

Former Member
0 Kudos


Try this way.

for(int i=0;i<<size of data>;i++)


IPrivate<ViewName>.I<DDNode>Element element=wdContext.create<DDNode>Element();









Former Member
0 Kudos


The value node in the example below is defined as follows:

Value node "MonthsOfYear", collection type=list, cardinality=0..n, selection=0..1

and the attribute:

Value attribute "MonthNameu201D, type=u201DStringu201D.

place this code in DoInit Method of View.

String[] monthNames = new String []


"January", "February", "March", "April",

"May", "June", "July", "August",

"September", "October", "November", "December",


//1. Create context elements for node "MonthsOfYear"

List monthsOfYear = new ArrayList();

for (int i = 0; i < monthNames.length; ++i)


IPrivateMainView.IMonthsOfYearElement month = wdContext.createMonthsOfYearElement();




and bind Value attribute "MonthNameu201D to DropDownByIndex UI Element.

for further information follow this link,



Edited by: Ramesh Babu V on Sep 1, 2008 11:19 AM