2 Replies Latest reply on Oct 31, 2011 5:13 AM by andrey.sisoyev

    A bug in the rich:calendar component in version 4.0.0.Final

    andrey.sisoyev

      Hi! I've found a bug in the standard Calendar component in version 4.0.0.Final

      richfaces-components-ui-4.0.0.Final.jar/META-INF/resources/org.richfaces/calendar.js:767

      htmlContent+='</tr><tr><td colspan="2" class="rf-cal-monthpicker-ok">'+

                   '<div id="'+this.DATE_EDITOR_BUTTON_OK+'" class="rf-cal-time-btn" style="float:right;" onmousedown="jQuery(this).addClass(\'rf-cal-time-btn-press\');" onmouseout="$(this).removeClass(\'rf-cal-time-btn-press\');" onmouseup="$(this).removeClass(\'rf-cal-time-btn-press\');" onclick="RichFaces.$(\''+this.id+'\').hideDateEditor(true);"><span>'+this.options.labels.ok+'</span></div>'+

                   '</td><td colspan="2" class="rf-cal-monthpicker-cancel">'+

                   '<div id="'+this.DATE_EDITOR_BUTTON_CANCEL+'" class="rf-cal-time-btn" style="float:left;" onmousedown="jQuery(this).addClass(\'rf-cal-time-btn-press\');" onmouseout="$(this).removeClass(\'rf-cal-time-btn-press\');" onmouseup="$(this).removeClass(\'rf-cal-time-btn-press\');" onclick="RichFaces.$(\''+this.id+'\').hideDateEditor(false);"><span>'+this.options.labels.cancel+'</span></div>'+

                   '</td>';

      Corrected version:

      htmlContent+='</tr><tr><td colspan="2" class="rf-cal-monthpicker-ok">'+

                               '<div id="'+this.DATE_EDITOR_BUTTON_OK+'" class="rf-cal-time-btn" style="float:right;" onmousedown="jQuery(this).addClass(\'rf-cal-time-btn-press\');" onmouseout="jQuery(this).removeClass(\'rf-cal-time-btn-press\');" onmouseup="jQuery(this).removeClass(\'rf-cal-time-btn-press\');" onclick="RichFaces.$(\''+this.id+'\').hideDateEditor(true);"><span>'+this.options.labels.ok+'</span></div>'+

                               '</td><td colspan="2" class="rf-cal-monthpicker-cancel">'+

                               '<div id="'+this.DATE_EDITOR_BUTTON_CANCEL+'" class="rf-cal-time-btn" style="float:left;" onmousedown="jQuery(this).addClass(\'rf-cal-time-btn-press\');" onmouseout="jQuery(this).removeClass(\'rf-cal-time-btn-press\');" onmouseup="jQuery(this).removeClass(\'rf-cal-time-btn-press\');" onclick="RichFaces.$(\''+this.id+'\').hideDateEditor(false);"><span>'+this.options.labels.cancel+'</span></div>'+

                               '</td>';

      The $(this).removeClass won't work, - you have to write jQuery(this).removeClass...

       

      Should I try making JIRA task out of it?