[richfaces-issues] [JBoss JIRA] (RF-11613) rich:calendar JS renderer uses $(this) instead jQuery(this)
Andrey Sisoyev (Created) (JIRA)
jira-events at lists.jboss.org
Mon Oct 31 05:12:45 EDT 2011
rich:calendar JS renderer uses $(this) instead jQuery(this)
-----------------------------------------------------------
Key: RF-11613
URL: https://issues.jboss.org/browse/RF-11613
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component
Affects Versions: 4.0.0.Final
Reporter: 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...
Just in case, I would suggest you scan these HTML generators for "$(this)".
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list