on 12-27-2007 3:59 AM
Hi all,
I need to take the present year and month from the system and have to populate in drodownlists. can any one help me how to get these two seperatly and populate. xxxxxx (please read forum rules)
regards,
Sharan
Edited by: Armin Reichert on Jan 17, 2008 10:23 AM
Hi,
Use
Calendar cal = Calendar.getInstance();
cal.get(Calendar.YEAR); // Year
cal.get(Calendar.MONTH) // Month
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can get the current year and month using the following code:
Date curr = new Date(System.currentTimeMillis());
int year = curr.getYear();
int month = curr.getMonth();
This two things you can poulate into an array and then to the attribute of your dropdownlist.
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you are using DropDownByKey UI elements:
1. Let's say the context attributes bound to the selectedKey property are called year and month respectively.
2. To populate year:
-
Date current = new Date(System.currentTimeMillis());
IWDAttributeInfo attinfo = wdContext.getNodeInfo().getAttribute(IContextElement.YEAR);
ISimpleTypeModifiable modinfo = attinfo.getModifiableSimpleType();
IModifiableSimpleValueSet valset = modinfo.getSVServices().getModifiableSimpleValueSet();
valset.put("currYear",String.valueOf(current.getYear));
-
3. You can do a similar thing for month.
Regards,
Satyajit.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.