You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by rawe <ra...@dachser.com> on 2010/06/04 13:13:36 UTC
Renderer does not work when datePicker is initially displayed
I`m using a renderer to work with the OutOfBoundsDate,
but it doesn't work when the DatePicker is initially displayed.
When I do some action in the DatePicker (e.g. change the month) the
OutOfBoundsDate is correctly rendered (here sundays and saturdays are
disabled)
e.g. I disable the weekend days, so I override the method
getAdditionalJavascript():
@Override
protected String getAdditionalJavascript() {
if (additionalJavascript == null)
additionalJavascript = "";
additionalJavascript += "${calendar}.addWeekdayRenderer(1,
${calendar}.renderOutOfBoundsDate);"; // disable sundays
additionalJavascript += "${calendar}.addWeekdayRenderer(7,
${calendar}.renderOutOfBoundsDate);"; // disable saturdays
return additionalJavascript;
}
Thanks for any help!
rawe
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Renderer-does-not-work-when-datePicker-is-initially-displayed-tp2243041p2243041.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Renderer does not work when DatePicker is initially displayed
Posted by rawe <ra...@dachser.com>.
Here is the solution:
Just use calendar's clear method:
e.g.
@Override
protected String getAdditionalJavascript() {
if (additionalJavascript == null)
additionalJavascript = "";
additionalJavascript += "${calendar}.addWeekdayRenderer(1,
${calendar}.renderOutOfBoundsDate);"; // disable sundays
additionalJavascript += "${calendar}.addWeekdayRenderer(7,
${calendar}.renderOutOfBoundsDate);"; // disable saturdays
additionalJavascript += "${calendar}.clear();";
//Clears the selected dates in the current calendar widget and sets
the calendar to the current month and year.
return additionalJavascript;
}
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Renderer-does-not-work-when-DatePicker-is-initially-displayed-tp2243041p2250097.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org