[Looking for Charlie's main web site?]

Having issues with the popup calendar feature after CF11 update 12 or CF2016 update 4? There's a fix

If you're using the cfinput type="datefield" feature to popup an calendar and are finding that it's not working correctly after ColdFusion 11 update 12 or ColdFusion 2016 update 4, there's a fix for it. (This could also happen if you're moving to CF11 or 2016 for the first time and someone else fully updated it before you started testing against it.)

The issue is discussed in a CF bug entry, CF-4198570, but since I've had a couple of customers recently ask for help on it, I thought I'd bring it up in a blog post here.

TLDR: you just need to obtain a special hotfix jar file, either the one for CF11 or the one for CF2016. (If you find that just clicking the link shows you gibberish in your browser, right-click the link and save the file instead.)

Put that saved jar in the lib\updates folder for your instance(s), and restart CF, and the problem will go away.

For more on the matter, as always, see below. :-)

Some code to demonstrate the feature and problem

Here's some very rudimentary code to demonstrate the feature and the problem if you run it in the affected versions. And note that this is about the HTML-based (javascript-based) calendar, not the older Flash one. And while I don't show this being within a CFCalendar tag, it can be used there also, with the same problem.)

<!--- page calls itself by default, by there being no ACTION attribute--->
<cfform>
<cfinput type="datefield" name="test" mask="YYYY/MM/DD">
<br><br>
<cfinput type="submit" name="submit">
</cfform>
<cfdump var="#form#">

When things work, once you select a date it should fill it into the field (whose format can be controlled with that MASK attribute).

When the problem is happening, you'll find first that the field is populated with a mask (unexpectedly), and more important it is NOT filled in when you select one from the calendar. Also, you may notice that when you click in the date input field, you may see some additional icons within it on its right side, in addition to the little calendar icon that should appear just outside of it. (The problem seems to happen in Chrome more often than other browsers, at least for some users I've talked with.)

Some other points

Before wrapping up, here are some other points that may interest some readers:

  • If you're not clear about the location of where to put the update jar file, for a typical Windows installation the CF2016 location would be C:\ColdFusion2016\cfusion\lib\updates. You'll see that that folder holds the jar file for whatever update may have been previously applied. Again, restart CF after making that change before testing if the problem is fixed.
  • I'd point out that this issue is NOT related to the recent removal of the YUI library, pulled in the refreshed installer for CF2016 released in December 2016, which can affect several UI tags. Note that for that problem, the page I just linked to offers a downloadable YUI library that you can "put back in place". (This is not the post to talk about that curious decision by Adobe, though I will note that they had announced deprecation of such things in CF2016.)
  • Note that the bug report's title indicates that this is a CF11 problem, but it does indeed apply to CF2016. And I can confirm that it was introduced in CF2016 update 4, CF11 update 12.
  • It may help for some to hear this: the CF update mechanism (in CF10 and above) does now automatically remove any manually placed hotfix files (like for this bug), so you don't need to worry about this "fix file" remaining in the lib/updates folder if/when some future update is applied.
  • That said, it would be nice to hear confirmation from Adobe that this fix will be included in the next update to both releases. (The "fixed in build" field on the top right here is currently empty as of this date I am writing.)

Finally, I want to say that this blog post is not the place for us to belabor the discussion of how and why people should be discouraged from using the various javascript-based UI tags and features. Both the issues above are certainly more reasons folks should consider that, as is the aforementioned deprecation. The writing is indeed on the wall.

Still, my role is a CF Server troubleshooter, and when someone comes to me wanting to fix this problem which may be preventing them going forward with an update or migration, they don't want to hear "remove all the CF UI tags and replace them with a better javascript library to do such things". But I realize some think that's what should be said always to anyone ever using them. :-)

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.005. (Want to validate the html in this page?)

Carehart Logo

Managed Hosting Services provided by
Managed Dedicated Hosting