Re: DatePicker configuration isn't always working

2010-06-10 Thread rawe

Yes, I solved it!
When displaying the calendar the first time it's mandatory to call its clear
method
(Clears the selected dates in the current calendar widget and sets the
calendar to the current month and year. )

My solution:

@Override
protected String getAdditionalJavascript() {
if (additionalJavascript == null)
additionalJavascript = ;

StringBuilder sb = new StringBuilder();

sb.append(${calendar}.addRenderer(\6/10\,
${calendar}.renderBodyCellRestricted););
sb.append(${calendar}.clear(););

additionalJavascript += sb.toString();

return additionalJavascript;
}
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DatePicker-configuration-isn-t-always-working-tp1878188p2250089.html
Sent from the Wicket - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DatePicker configuration isn't always working

2010-06-08 Thread rawe

Did you already solve your problem?
I got the same problem.

Thanks for any help!

Ralph Weyers
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DatePicker-configuration-isn-t-always-working-tp1878188p2247457.html
Sent from the Wicket - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



DatePicker configuration isn't always working

2009-02-19 Thread Trent Larson
We are trying to use the DatePicker, only allowing the selection of days
5-25 of each month.

We've tried adding the following renderer to work with the OutOfBoundsDate,
but it doesn't work when the calendar is initially shown.  For example, if
the pageDate of the calendar is set to 03/2009, the 1st through the 4th of
April and May will be disabled as expected, but the 1st through the 4th of
March will be enabled.  When navigating back to March, the 1st through the
4th are then disabled, as expected!  Also, closing the calendar and
reopening it disables the 1st through the 4th, which is what we want... but
we want it to start out with those dates disabled.

for ( int i = minCal.get(Calendar.*MONTH*); i = maxCal.get(Calendar.MONTH);
i++){
 javascript += ${calendar}.addRenderer(\ + (i + 1) + /1\,
${calendar}.renderOutOfBoundsDate);;
 javascript += ${calendar}.addRenderer(\ + (i + 1) + /2\,
${calendar}.renderOutOfBoundsDate);;
 javascript += ${calendar}.addRenderer(\ + (i + 1) + /3\,
${calendar}.renderOutOfBoundsDate);;
 javascript += ${calendar}.addRenderer(\ + (i + 1) + /4\,
${calendar}.renderOutOfBoundsDate);;
 


We also thought we might do something special on the 'init' method, and we
noticed an old 'appendToInit' method, but it's deprecated.

Thanks for any ideas.
Trent