JQMobile Helper extension updated

I have released an update to JQMobile Helper extension ColdFusion Builder 2.  This update updates the base template and tags to match the current release of jQuery Mobile (alpha 4.1).  You cna download the extension at the link below.

 

http://jqmobilehelper.riaforge.org/

 

As always, if you find any issue with the extension please let me know.

Till next time.. 

--Dave

 

JQMobile Helper

I have been tinkering with jQuery Mobile since the first alpha.  I have even built a few things with it.  I have found it to be a very powerfull way to create mobile applications with little or no JavasScript.  Not to say that writing JavaScript is bad, just pointing out the ease of use that jQuery Mobile brings to the table.

When working on things I always found myself doing one of two things.  Either copying and pasting code from other projects or gettting samples from the JQM site. These both worked just well but it just seemed inefficient to me.  I started creating myself a snipits library of things I commonly used.  This seemed to work much better as I now had some generic sample code to use in projects.  However, I never had everything I was looking for.

It was then that I thought there could be a better way.  This is when JQMobile Helper, a ColdFusion Builder 2 extension, was born.  This gave me all the common elements I was using and then some.

In building the extension I ran into a couple challenges.  

First, this was my first extension that would have no UI elements.  This created some unique debugging challenges but none that weren't easily dealt with.  

Second hurdle was using call backs.  This was the first extension I have built that would use them.  The documentation on how they work is a bit hit add miss so this part was harder than it needed to be.  I eventually found an example and was able to use it as a base for my work.

My third issue was overcoming code bloat.  This in itself was not a major issue but more of an architectural issue. I wanted to reduce the amount of code in the extension as most of it was redundant.  After asking around about the issue, Ray Camden came up with a great idea that worked perfectly.  

The hardest part of all this was gathering all the snipits of code.  Not only that but then grouping them into some logical order. 

All said and done the extension was fun to build.  I learned a lot more about extensions and gained some knowledge that I can apply to future extensions.

 

You can view/download the extension here: http://jqmobilehelper.riaforge.org/

 

Till next time,

 

--Dave

 

 

ColdFusion Builder Extensions - Creating Menu Filters

Well, I have been working on building an extension for ColdFusion builder. I wanted to make it so that the menu for the extension was based on what was selected. This seemed simple but the documentation on extensions was a bit lacking in this area. But, after digging, searching, and looking at examples, I was able to figure it out.

There are two core ways to do a filter. The first is by the entire menu itself. The second is by the action in the menu.

So, lets say I wanted to display the menu only when a user selected a directory. The menu would look like this..

view plain print about
1<menu name="My Extension Menu">
2    <filters>
3        <filter type="folder" />
4    </filters>
5    <action name="My action" handlerid="actionHandler" showresponse="true">
6</menu>

This is good... I can also add a pattern to the filter to have it filter not only on a directory but possibly on the directory name. This can be done using regular expressions. This example will only work if the directory name is "style".

view plain print about
1<menu name="My Extension Menu">
2    <filters>
3        <filter type="folder" pattern="style" />
4    </filters>
5    <action name="My action" handlerid="actionHandler" showresponse="true">
6</menu>

Creating filtered menus is great. But, you will need to create an entire menu node for each filter. You can end up with bloated XML very quickly. This is where assigning the filter to the action comes into play. This allows for the same menu but different actions.

This example below will display two different actions for the same menu. The first is if the user selected a directory. The other is if they selected an XML file.

view plain print about
1<menu name="My Extension Menu">
2    <action name="My action - Folder" handlerid="actionHandlerFolder" showresponse="true">
3        <filters>
4            <filter type="folder" />
5        </filters>
6    </action>
7    <action name="My action - File" handlerid="actionHandlerFile" showresponse="true">
8        <filters>
9            <filter type="file" pattern=".*\.(xml)"/>
10        </filters>
11    </action>
12</menu>

You can read more about it here on the Adobe help Docs

Till next time..

--Dave