on 04-01-2008 8:12 AM
Hi,
when binding a date type to a inputfiled, we will get a valuehelp with a calendar. clicking it will display the current month. If I want to display the other month( example: It's April now. I want to display next year's April).
How can I do?
Thank you!
Thank you for everyone.
But I really means that, I want to modify the calendar's valuehelp.It default display current month, can make it display another month when I click the icon in the inputfield?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
But I really means that, I want to modify the calendar's valuehelp.It default display current month, can make it display another month when I click the icon in the inputfield?
When you click on the icon calendar is displayed based on the value which is available in the text box or else the default one. If you want this to change to that of yours you need to set the value as part of the context attribute bound to this inputfield, to do this pl refer my prev post.
Regards
Ayyapparaj
Thank you everyone!
I have solved this issue
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 use the following code to acheive your requirement
Calendar.getInstance().set(Calendar.MONTH, 4);
Calendar.getInstance().set(Calendar.YEAR, 2008);
Date dt = new Date(Calendar.getInstance().getTimeInMillis());
//Align the following code to that of your context attribute.
wdContext.currentContextElement().setDate(dt);
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 ,
If ur value Attribute is date , assign initial value as next years date, then next years calender ill be displayed.
java.sql.Date sqlDate = java.sql.Date.valueOf( "2008-04-01" );
wdcontext.curretContextElement.setDate(sqlDate);
Regards,
Sunitha Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinny,
I hope you have seen the month and year navigation panel on the pop up calendar. You can use to get next year.
Or if you want to do it through code, you can use the Calendar/ Date Class and set date to the Calendar/Date Object and assign this to the InputField.
Its simple.
Regards
- Vinod
Edited by: Vinod V on Apr 1, 2008 1:12 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.