Dear Vince,
The calendar should not show the current day, but the day which is
currently saved in the backing value. I suspect that you are
initializing the value in the backing bean with the current day.
So if you declare your calendar as following:
<t:inputCalendar value="#{TestBean.inOneYear}" />
It will show the date which is set in the backing bean.
The following example will initialize the calendar with the current
date, but the year set to 2013.
public Date inOneYear;
//Constructor
public TestBean() {
Calendar nowCal = new GregorianCalendar();
nowCal.set(Calendar.YEAR, 2013);
inOneYear = nowCal.getTime();
}
// getter
public Date getInOneYear() {
return inOneYear;
}
// setter
public void setInOneYear(Date pInOneYear) {
inOneYear = pInOneYear;
}
The calendar on your page should show this:
< Mai 2013 >
Mo Di Mi Do Fr Sa So
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
If you change the month and save the date and then navigate back to
this page later it should open the calendar on the new month, provided
that the backing bean is in session scope.
Tobias Eisentraeger
On Tue, May 29, 2012 at 5:01 PM, vinbr88 <vinbr88@googlemail.com> wrote:
>
> Hello,
>
> I am using the t:inputCalendar in my application and it works fine.
> When I click on the calendar symbol, the current date is selected every
> time. So if I want to change the date by one day, I have to browse to the
> corresponding day and year of the last date, which is very annoying.
> Because every time the current day is selected.
>
> Is there a possibility to popup the calendar with the last selected date
> and not with the date of today?
>
> Thank you in advance.
>
> Vince
|