cancel
Showing results for 
Search instead for 
Did you mean: 

populating values in to dropdownbyindex?

Former Member
0 Kudos

Hi

i have dropdownbyindex with label Academic Year, now i need to populate values in to it in the form of 2000-2001,2001-2002.....2049-2050.can u tell me the required code to populate the values(from 2000-2001 to 2049-2050)

thanks

kishore

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

Use Surender's code with nominal change


// current 
ele.setCtx_va_year(i+"-"+i+1);

// Use Instead
ele.setCtx_va_year(i+"-"+(i+1) );

In first one output will be 2000-20011, 2001-20021 ....

Mandeep Virk

Former Member
0 Kudos

Hi,

Iam assuming that u have bound ur dropDownByIndex to a

string type context.

Create a node say ctx_vn_year and create a value attribute

say ctx_va_year into it .Bind ctx_va_year to ur

dropDownByIndex ,use following code to fulfill ur

requirement.


IPrivateMyappView.ICtx_vn_yearElement ele;
wdContext.nodeCtx_vn_year().invalidate();
for(int i =2000;i<2050;i++)
{
	ele=wdContext.nodeCtx_vn_year().createCtx_vn_yearElement();
	ele.setCtx_va_year(i+"-"+(i+1));
	wdContext.nodeCtx_vn_year().addElement(ele);
}

Regards

Surender Dahiya

Former Member
0 Kudos

Have you read the documentation (Javadoc)? If yes, what is still unclear?

Armin