I'm trying to use cfmessagebox.
I found an example but nothing happens.
Where is the error? Is it compatible with all browsers?
Thank you for your help.
No answer ?
Help me please.
Thank you in advance.
Dave Watts, Eidolon LLC
I agree with Dave Watts.
I've replaced CFMessageBox with SweetAlert2. It's more complicated to integrate (compared to some of the CFUI tags), but's it's more future proof regarding device/browser compatibility and is actively developed.
You need something to create an event. So replace
In any case, follow the advice from Dave and Jamo. ColdFusion UIs, such as cfmessagebox, are out of date.
I find it unfortunate that Adobe (or some other company!) Doesn't provide a library of includes which will avoid reinventing the wheel all the time.
Here is the first:
Thank you all.
ZNB, Adobe DID provide such a library. It's what made the cfmessagebox (and several other CFML UI tags) work.
The problem with that approach is that the libraries often either changed quickly (perhaps for addressing security reasons), or got dropped by the vendor (because this world of JS-based UI elements has been evolving and changing for 2 decades).
So nearly everyone--or at least everyone who was concerned about the above issue--has spent the better part of the past two decades complaining that Adobe should in fact never have put in such libraries, and that instead people SHOULD "just do it themselves".
Here you see the conundrum: a total "damned if they do, damned if they don't" situation.
FWIW, the very reason your initial cfmessagebox failed is likely because in CF2018 and after a certain update in CF2016 as well, Adobe REMOVED the old library (yui) that was underlying its functionality. In the CF docs on "deprecated features", they tell folks how they can add it back. But you will be adding back an old library that the vendor (yahoo) no longer supports at all.
Could Adobe have instead designed the whole UI tag featureset in such a way that folks could plug in "more modern versions" of the libraries they used? Sure. That would have been brittle--because the vendor could change something that would now make existing CF code break. And it would have been expensive, if they then had to deal with fixing issues in CF that now failed with those later libraries.(Some might even wish that they could let folks plug in ANY UI library, but there's no way that could have been expected to work.)
Adobe opted instead to keep things at a stable base, for those who wanted these tags...but again there was always an outcry from certain quarters that Adobe shouldn't be providing such "training wheels"--or worse, "a gun with which folks could shoot themselves". Not everyone agreed with that assessment, and I can tell you that many, many people are still using these UI tags today, after "putting the libraries back in". To each, their own.
You have come to the result that most would want: find and use a JS UI library that works for you.
As for the hope that anyone will ever make that easier, I doubt it. There are just too many concerns to be managed.
Hope that's helpful. (I know it's WAY more than most would want to hear/read, but given your last question, it seemed a reply that was warranted.)