Hi Leo...

Thanks... It helped me further on.

I made it work, in a non-wicket purely javascript version.

But something goes wrong in the wicket datepicker version.

I override the getAdditionalJavascript method for the DatePicker with the
following:

    @Override
    protected String getAdditionalJavascript() {
        String myRenderer = "var myCustomRenderer = function(workingDate,
cell) {\n"
                + "                     cell.innerHTML = 'x';\n"
                + "                     YAHOO.util.Dom.addClass(cell,
'disallowed');\n"
                + "                     return
YAHOO.widget.Calendar.STOP_RENDER;\n}";

        return myRenderer + "\n YAHOO.wicket['" + getComponentMarkupId() +
"DpJs'].addWeekdayRenderer(1, myCustomRenderer);";

But for some reason i can't associate the customRenderer with the
datepicker.

Any hint's on how to do that ?

I must admit i am relatively new to wicket.

Thanks in advance.

Muro


On Fri, Nov 20, 2009 at 9:26 PM, Leo Erlandsson
<[email protected]>wrote:

>
> This is certainly possible.
>
> You need to use YUI Calendar Renderers. They are documented in the YUI Cal2
> API Doc. You can find an example of what you are trying to achieve here
> (thanks Google):
>
> http://www.stephaniebender.de/extras/yui/examples/calendar/render/1.html
>
> Basically, you'll want to do this for all disallowed weekdays:
>
> var myCustomRenderer = function(workingDate, cell) {
>            cell.innerHTML = "X";
>            YAHOO.util.Dom.addClass(cell, "disallowed");
>            return YAHOO.widget.Calendar.STOP_RENDER;
> }
> YAHOO.example.calendar.cal1.addWeekdayRenderer(1, myCustomRenderer);
>
> This will put an X on all Sundays, making them disabled. Also, it will add
> a
> CSS class ('disallowed') that can be customized if you want to change the
> appearance of disabled cells.
>
>
> --
> View this message in context:
> http://old.nabble.com/Wicket-datepicker-disable-weekdays-tp26444084p26447477.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to