ColdBox JQueryUI Plugin
I work quite a lot with JQueryUI 1.8 lately, so time has come to create a new CB plugin. The JQueryUI Plugin handles (core)JS dependencies and CSS links for you, so no CFHTMLHEADs in your views anymore to include the proper files. You can just write:
jQueryUI = getPlugin("JQueryUI",true);
jQueryUI.setEnableWidget('tabs');
</cfscript>
jQueryUI.setEnableEffect('bounce');
// other code
jQueryUI.setEnableEffects('bounce,blind');
// other code
jQueryUI.setEnableEffect('explode');
</cfscript>
<cfdump var="#jQueryUI.getWidgetNames()#">
jQueryUI.setCustomJsLink('includes/js/myfile1.js');
jQueryUI.setCustomJsLink('includes/js/myfile2.js');
jQueryUI.setCustomJsLink(src='includes/js/myfile3.js',renderPosition=( arrayLen(jQueryUI.getCustomJsLinks() )-1 ));
jQueryUI.setCustomJsLink(src='includes/js/myfile4.js',renderPosition=2);
// first position
jQueryUI.setCustomJsLink(src='includes/js/myfile5.js',renderPosition=1);
</cfscript>
- Grab the JQueryUI plugin from RIAForge and place it into your plugin folder
- Download jqueryui 1.8.1, unzip it into your includes folder (See screenshot below)

- Add the following lines to your coldbox config file
<!-- Path to jQueryUI library, e.g. includes/jqueryui -->
<setting name="JQueryUIPlugin.baseRelativePath" value="includes/jQueryUI" />
<!--
<Setting name="JQueryUIPlugin.cssRelativePath" value="includes/jQueryUI/themes/ui-lightness" />
<Setting name="JQueryUIPlugin.jsRelativePath" value="includes/jQueryUI/ui/minified" />
<Setting name="JQueryUIPlugin.jsFileNameSuffix" value=".min" />
--> - Place this code somewhere in your layout file. This renders the output of the plugin.
<cfoutput>#getPlugin("JQueryUI",true).render()#</cfoutput>


You were right. Somehow version 1.1 did not make it to the download section.
Just uploaded version 1.1 again.
It looks to me that the folder structure expected by your cfc is quite different than what gets downloaded from the JQuery site. Could you confirm?
Thanks
I renamed the folder to JQueryUI (screenshot) for convenience.
To set the JQueryUIPlugin.baseRelativePath in CB 3 M6 you need to use a Coldbox.cfc config file written Programmatically (not xml). If, like me, you're updating to CB3, and need to write a non xml config file from scratch... there is great documentation on the CB wiki "ConfigurationCFC".
I created a new app through the dashboard with reinit fw every request enabled, deleted the xml.cfm config file and built a cfc config using the guide on the wiki. 1 setting at a time with lots of testing. If ( like mine ) the app is not in the webroot and you get not found errors, check you are using an appMapping setting.
The file layout & settings section of the config file looks like this...
mySite
- includes
- - jQueryUI
- - - jquery-1.4.2.js the core jquery js
- - - jquery-ui-1.8.5-custom-min.js optional jquery code (if you chose extras like effects)
- plugins
- - JQueryUI.cfc (if you use a sub folder, remember to add it when getting the plugin)
- config
- - Coldbox.cfc
settings = {
// settings here
};
settings[ 'JQueryUIPlugin.baseRelativePath' ] = 'includes/jQueryUI';
// jQuery Setting for CB3
And that is working for me. The only other issue was a component not found error caused by not restarting CF after updating the Coldbox folder. Now of to play with this plugin :)
However, I have followed your instructions and got the following error:
Application Execution Exception
Error Type: Controller.SettingNotFoundException : [N/A]
Error Messages: The setting jQueryUIPlugin.baseRelativePath does not exist.
FWSetting flag is false
I have added the files into my directory based on what you have suggested.
could you please advice me in what may went wrong?
Thanks!