ColdExt Wiki and Getting Started Tutorial

Having a bunch of custom tags and an XML dictionary for CFEclipse is one thing, but knowing how to use them is another! So last night I began working on every developer's favourite task... documentation :P

The ColdExt Wiki is now enabled on RIAForge and I have started out with baby steps by writing a Getting Started Tutorial which covers the absolute basic requirements of getting up and running with ColdExt.

I have a number of pages and tutorials planned for the wiki (some of which I have already made notes of on the wiki home page) and will get around to adding them as soon as I can. If anyone would like to help out with documentation (rofl!) or start a discussion about what documentation is needed the ColdExt Forums could be a good place to do it. I am open to suggestions!

The next release of ColdExt will very much be about better documentation and demos, in addition to more tags and enhancements of course :)


P.S. Does anybody know if it's possible to turn off WikiTerms on RIAForge? At the least I think a special token like __NOTERMS__ would be very useful.

ColdExt Beta 1 with CFEclipse tag insight!

I'm fairly excited about this release because it has some really cool stuff in it :) I've already dropped the biggest bombshell in the blog post title, which is support for tag insight in CFEclipse - very nice!, but there are a bunch of other nice updates and new features as well...

Changes at a glance include;

  • 7 new tags, 3 new grid demos
  • 90%+ of the tags have been updated with inline documentation
  • EditorGridPanel provides support for editable grids (only supports input and comboBox fields at this time, more to come very soon)
  • GroupingStore and GroupingView can now be used for grouping in both GridPanel and EditorGridPanel
  • GridRowNumberer can be used as a numbered column in Grids (though it doesn't support paged grids - by design from the Ext Team)
  • New <ext:html> tag for including arbitrary chunks of HTML inside panels and forms
  • Tags which don't require a closing tag will now work as a single tag without a trailing slash (partial support)
  • Tags which require a closing tag will throw an error if the closing tag is missing (partial support)
  • Initial implementation of attribute validation in some tags (starting with the panel tags to assist with rendering issues)
  • Support for including the Ext debugging JS
  • The bundled version of CFJSON has been updated to the latest v1.9
  • CFEclipse tag insight (/dictionary/coldext.xml)


Download ColdExt Beta 1 from RIAForge

Here are the new online demos:


I will refrain from posting screenshots and code listings of the demos this time round since you can download everything you need and view the working demos above (well, that and it's getting late here in Oz and I need some sleep!) :)

One thing you need to know though is how to set up the coldext.xml file to work in CFEclipse. Just browse to the "plugins\org.cfeclipse.cfml_1.3.1.5\dictionary" directory inside CFEclipse (your CFEclipse plugin version number may vary) and insert a copy of the ColdExt "dictionary\coldext.xml" file. Then in the same location, make a backup of the "dictionaryconfig.xml" (just in case) and then open it to make the following modification, inserting a single line to include the coldext.xml file:

<version key="cf8" label="Coldfusion 8">
    <grammar location="cf8.xml" />
    <grammar location="user.xml" />
   
<grammar location="coldext.xml" />
</version>

Give CFEclipse a restart and you should now be swinging with ColdExt tag insight!

coldext-tag-insight

*Note that at this stage only the attributes for about 90% of the tags are documented, I haven't gotten around to inline help for the actual tags themselves just yet...


If you have any feedback about this release feel free to post here in the comments or make use of the features on RIAForge:

All feedback, bug submissions, feature requests and comments are much appreciated :)

ColdExt Alpha 2 release

This release almost took me a couple of weeks to get out the door, and with 5 new tags and 13 updated/improved tags ColdExt is getting that little bit closer to being usable in the real world.

New tags include support for components such as accordions, tools with onclick handlers, tooltips, and xtemplates. The updated tags include better support for container layouts, tabs and treePanels. And there are 2 new demos to check out as well :) As usual, just extract the folders to your webroot to get up and running quickly.

Download ColdExt Alpha 2 from RIAForge

In this release the Ext files are no longer bundled so you will need to head over to the Ext JS Download page, grab the Ext 2.0.1 release and extract it to a temporary directory. Then in your webroot, where you have already placed the "coldext" and "demos" folders from the ColdExt Alpha 2 release, create a new folder called "ext". As per the image below, into the new "ext" folder you just need to place a copy of "ext-all.js" (from the "ext-2.0.1" folder) and "ext-base.js" (from the "ext-2.0.1\adapter\ext" folder), and both the "css" and "images" folders (from the "ext-2.0.1\resources" folder), then you should be right to go.

ColdExt folder structure

The first new demo is the ColdExt Accordion demo which is a replica of the Accordion Window that is in the Ext Desktop demo (minus the minimize/maximize functionality).

Here is a screenshot of the accordion demo as it is rendered:

coldext-accordion1 

And below is the main chunk of ColdExt code used to construct the accordion demo:

<ext:init />
<ext:onReady> 

    <ext:createChild renderTo="out" tag="h1">ColdExt Example Accordion (Ext Replica)</ext:createChild> 

    <ext:window var="myWindow" title="Accordion Window" layout="accordion" iconCls="icon-accordion"
                width="250" height="400" border="false" resizable="true" show="true">
        <ext:toolbar>
            <ext:toolbarButton icon="icons/fam/connect.gif">
                <ext:tooltip title="Rich Tooltips" text="Let your users know what they can do!" />
            </ext:toolbarButton>
            <ext:separator />
            <ext:toolbarButton icon="icons/fam/user_add.gif" tooltip="Add a new user" />
            <ext:toolbarButton icon="icons/fam/user_delete.gif" tooltip="Remove the selected user" />
        </ext:toolbar>
        <ext:treePanel id="myTree" title="Online Users" lines="false" rootVisible="false" margin="0 0 5 0">
            <ext:tool id="refresh">
                <ext:onclick>
                    var tree = Ext.getCmp('myTree');
                    tree.body.mask('Loading', 'x-mask-loading');
                    tree.root.reload();
                    tree.root.collapse(true, false);
                    setTimeout(function(){
                        tree.body.unmask();
                        tree.root.expand(true, true);
                    }, 1000);
                </ext:onclick>
            </ext:tool>
            <ext:rootNode>
                <ext:treeNode text="Friends" expanded="true">
                    <ext:treeNode text="Jack" iconCls="user" />
                    <ext:treeNode text="Brian" iconCls="user" />
                    <ext:treeNode text="Jon" iconCls="user" />
                    <ext:treeNode text="Tim" iconCls="user" />
                    <ext:treeNode text="Nige" iconCls="user" />
                    <ext:treeNode text="Fred" iconCls="user" />
                    <ext:treeNode text="Bob" iconCls="user" />
                </ext:treeNode>
                <ext:treeNode text="Family" expanded="true">
                    <ext:treeNode text="Kelly" iconCls="female" />
                    <ext:treeNode text="Sarah" iconCls="female" />
                    <ext:treeNode text="Zack" iconCls="green" />
                    <ext:treeNode text="John" iconCls="green" />
                </ext:treeNode>
            </ext:rootNode>
        </ext:treePanel>
        <ext:panel title="Settings">
            Something useful would be in here.
        </ext:panel>
        <ext:panel title="Even More Stuff">
            Something useful would be in here.
        </ext:panel>
        <ext:panel title="My Stuff">
            Something useful would be in here.
        </ext:panel>
    </ext:window> 

</ext:onReady>
 

Next up is the ColdExt Combobox demo which makes use of the XTemplate templating features that Ext provides. Templates are mostly used with the DataView component which the Combobox uses internally for rendering its list of items (note that I haven't yet implemented DataViews directly in ColdExt, they will be coming in the next release!). Not only can templates display simple data values but they can do logic, simple calculations and even implement member functions for more complex actions, as per the example below.

Here is a screenshot of the Combobox and XTemplate in action, rendering some data side-by-side in a list:

coldext-combobox-template1

And below is the code used to produce the Combobox. Take special note of the XTemplate tag and the nested member function that is used in the template, it's a super powerful feature IMO.

<ext:init />
<ext:onReady>

	<ext:createChild renderTo="out" tag="h1">ColdExt Custom Example Combobox</ext:createChild>

	<!--- coldext custom example - combobox --->
	<ext:createChild renderTo="out" tag="h2">Combobox 1 - XTemplate Example</ext:createChild>

	<ext:jsonStore var="myJSON" url="data.cfm">
		<ext:storeField name="id" />
		<ext:storeField name="country" />
	</ext:jsonStore>

	<ext:formPanel border="false" renderTo="out">
		<ext:comboBox name="country" emptyText="Select a Country..." hideLabel="true"
				displayField="country" valueField="id" store="myJSON">
			<ext:xtemplate>
				<tpl for="."><div class="x-combo-list-item">
					<span class="country">{country}<tpl if="this.isCode('KZ', id)">, very nice!</tpl></span>
					<span class="code">{id}</span>
				</div></tpl>
				<ext:script>
					isCode: function(a, b){
						return a == b;
					}
				</ext:script>
			</ext:xtemplate>
		</ext:combobox>
	</ext:formPanel>

</ext:onReady>
 

Anyway, that's about it for this release. If you have any questions, comments, feedback or feature requests please feel free to drop me a note in the comments.

Even my local KFC loves Ext JS?

I don't get drive-thru takeaway very often (honest!), but I couldn't help snapping this pic on my phone yesterday while grabbing some lunch at KFC...

Proceed to ext window

Apparently the staff there love Ext JS too, or "ext windows" to be more precise :)

ColdExt first alpha release on RIAForge

Well, I've finally got the ColdExt code into a clean enough and complete enough state to release something that is useful enough to be played with :) There are a number of things this release doesn't do, but it does handle form functionality well enough that you can use it to build reasonably rich forms, validate the input and POST form data back to the server. Just a taste of things to come I guess!

Download ColdExt Alpha 1 from RIAForge

ColdExt comes bundled with the latest Ext 2.0.1 release so you don't need to download it separately. Basically you can just drop the "coldext" and "ext" folders into your web root, set your Application Name in an application.cfc/cfm and start playing with it immediately.

At this stage the examples are very light (check the /demos folder), but if you are familiar with Ext or don't mind browsing the Ext documentation and the Ext examples then I'm sure you will pick things up in no time (there are LOTS of attributes that can be used with each tag if you want to/need to).

I also have a couple of live demos up here:

Keep your eyes peeled for more ColdExt related posts to follow shortly...

ColdExt - an Ext JS tag library?

Over the last few months I've been tinkering with Ext JS and the possibilities of a ColdFusion tag library to make development with Ext a little easier and quicker. I had originally started working with Ext 1.1, concentrating simply on Forms support, but put development on hold because I had heard Ext 2.0 was on the horizon. With it's release towards the end of 2007 I realised that the small amount of work I had already done wasn't compatible with the changes in Ext 2.0, and I was also short on time in the weeks leading up to Christmas.

Over the New Year's break I found myself with some spare hours and finally sat down to write a few tags. I thought I'd try my hand at a Panel component, until I hit a bit of a roadblock with custom tag generated content and outputting to a variable inside a block of JavaScript output. After returning from my holiday (yeah I was coding on holiday, who does that?!) I came across a post by Dan Vega titled Custom Tag JavaScript problem mentioning the toScript function, which was exactly what I needed - thanks Dan! ;)

Since then I've written about 25 custom tags to support various Ext components including; Button, ColumnLayout, DateField, FieldSet, FormPanel, HTMLEditor, Panel, TabPanel, TextField, TimeField, Toolbar, Toolbar.Button, Toolbar.Fill, Toolbar.Separator, and other helper tags to define global configuration of some default options, initialise the library, define form submission handlers for AJAX support, and more...

At this point I'm considering what to do with the library, which I've unimaginatively named ColdExt.

Back in early December 2007 when Brian Love released Ext.cfc there was a bit of talk about a tag library which a number of us had seemingly been mulling over. My situation is that I need to start using some kind of UI library during February, and over the last couple of weeks I think the concept has proved to be feasible. My aim is to cover as many as components as I can but with as much flexibility as I can so that nothing will interfere with using Ext in the pure JS form that it was intended. As far as sharing the code goes I'm more than happy to release it and/or set up a project on RIAForge if there is any interest. I'll save the discussion of the technical design aspects of the library for another post to follow though, because there are a few things that I would like to open up to comments :)

Anyway, here is a sneak peak of some screenshots and the code snippets that produce them:

Initialising the library is as simple as:

To create and render a FormPanel that uses AJAX:

... which produces this working form:

A replica of a slightly more complex layout from the Ext Example Dynamic Forms:

... which produces:

So there you have it! As I said I'll write another post to discuss how I've designed the library so far, and I'll see if I can put some working examples up by the end of the week. Please feel free to give me your thoughts on what I've shown so far :)

BlogCFC was created by Raymond Camden. This blog is running version 5.6.001.