Adobe Developer Week Sessions now live.

Posted by Neil on June 21, 2006

Yup, finally, Adobe have made last weeks sessions available to everyone who couldn't make the original live sessions (i.e those of us not in the U.S)

The Adobe Engagement Platform
Introduction to Developing with Flex
Introduction to Adobe LiveCycle
Building Flex Apps with Flex Builder
Flex Data Services
Building Killer RIAs? Meet: Adobe's Next-Gen Technology
Architecture and Overview of Adobe's Security Model
ColdFusion Powered Flex
An Introduction to Adobe LiveCycle Workflow and Qpac
ActionScript 3 for Flash Developers
Looking for IT Agility, Sizzling Apps & Fast Processes
ColdFusion and Model Glue
Using InDesign Server with Flex
Building Applications using LiveCycle and Flex
Flex and AJAX Better together
Smart Client Architecture and Processing Models

Flex 2 Puzzle No 3

Posted by Neil on June 20, 2006

Real quick test this week due to lack of time on my part, but still something that puzzled me somewhat coming from a CF background.

Quite simple. How do I evaluate something in Flex?

e.g The equivalent in CF:

Flex 2 Puzzle No 2: The Answer(s)

Posted by Neil on June 15, 2006

Another puzzle down, and again, a whole load of good answers and feedback. Hopefully some of you are learning something from this.

The answers I am using today are from Kevin Hoyt as they provide the clearest examples of the way to do things. They are also the closest to what I had. This code can be downloaded in a zip file from here.

Ok, lets break this down into two parts. The “Please Select” prompt, and the formatting of the select items.

1) Please select

Some of you spotted the very easy way of doing this, i.e via the mx:ComboBox “prompt” attribute. This gives you the ability to provide a string as the selected element until another item is selected. At this point, the Prompt value is removed.

So what if you want to have the item showing all the time, i.e you want to add an element that has meaning, but is not returned from the webservice? Well, this is where we need to treat the combo as what it really is, an array of objects. By manipulating this array, we can perform pretty much anything we want on it. We can reformat values, we can add or remove values etc etc. If you take a look at the source of squirrelFixed.mxml you will notice a function doPrompt(). This function creates a new object, then sticks it into element 0 of the categories arrayCollection. Due to the bindings, this essentially has the same effect as adding it to the combo.

So why the arrayCollection? Well, these come in handy for quite a few things, mainly being able to manipulate some data without having to do anything fancy such as reinvoking a webservice. Try to think of an array collection as an array of structures in CF.

2) Reformatting the options

Easy one this, that a lot of people made extra complicated for themselves. The key? The labelFunction attribute of mx:ComboBox. This little gem lets Flex redirect an object to a given function that then returns a string containing the label. The benefit of this is that you do not need to pre-process this label, or save it off anywhere in another object. You simply process the labels when you need to see them. Cool huh? For an example, take a look at squirrelPrompt.mxml and categoryMerge(). Notice that this is only talking in the context of the single object passed in (which happens automagically).

So in summary, I hope that this has pointed out that Flex usually provides a neat simple way of doing most things, you just need to look through the API's. And secondly, that if something doesn't quite fit, you can take it on yourself and do it your own way.

Stay tuned next week for the next test.

In a puzzling mood

Posted by Neil on June 13, 2006

Here's another little puzzle to pass the time.

Using the numbers 8, 8, 3 and 3, and only using addition, subtraction, multiplication, division and parantheses get the answer of 24 (exactly)

Flex 2 Puzzle No 2

Posted by Neil on June 12, 2006

OK, here's the next Flex test. I've had some feedback on the first one and decided to do these tests surrounding a common theme, i.e Feed-Squirrel and the webservices that it provides.

This weeks test is quite simple. Last week you created a combo containing the information from the FS Webservice. Now, using the same webservice, and using the same Combo, bind the data in a similar way, but with some tweaks:

Firstly, add a “Please Select” element to the start of the list, and secondly, prefix each item with it's categoryID. So, you should end up with the following in your combo:


Please Select
1. Coldfusion
2. Flex
3. Flash
4. Technology.

When I receive a valid answer (comments or email will do), I'll post it and try to write a coherent explanation.

Go!

CREATE TABLE from CF 7

Posted by Neil on June 08, 2006

Just a heads up on a problem I have come across that just had me head scratching for a while.

I had a query that was creating a temp table and then using the table later on in the same statement. This was working fine in our development environment, but then fell over when it went to test. As this is perfectly valid SQL it had me thinking hard for a while.

What the problem turned out to be was the JDBC driver in CF. We had upgraded the JDBC driver to DataDirect 3.5. What we found is that this driver has an aversion to running CREATE's and INSERTS in the same statement, whereas SQL Server itself and the DataDirect 3.3 drivers don't mind one little bit.

The solution? Well, we migrated that DSN to an ODBC socket as we have other code that broke on 3.3, but you could either downgrade back to 3.3 or see if you can upgrade further.

Flex 2 Puzzle No 1: The Answer

Posted by Neil on June 07, 2006

OK, from the email I have received, a few of you have tried this, some with some success, and some without. The main problem people were having is related to the way of thinking that a traditional CF/HTML developer has. In HTML a select consists of values and labels:

bar

However, in Flex, this isn't the case, each item of a select (or combo to give it it's correct name) is an object. This essentially means you can chuck pretty much anything you want at the combo, you just need to tell it what part of the object is the label value. (Remember, I said this would be enlightening).

So if we take some mxml (which answers the question):

You will see a webservice being called when the application has finishing loading, this then returns a load of objects, which are in turn bound to the combo's dataprovider. To get a label simply point Flex at the item in the object that represents your string label (in this case CATEGORYNAME) using the labelField attribute. This will give you your Combo with your labels.

So how do we get at the data? Well, remembering these are objects in the combo, the data is right there in each items relevant object (so in theory you can have loads of data fields in one combo!). To demonstrate this we have a label bound to the selected items CATEGORYID.

So, now you know. If you are a HTML/CF developer this would have probably been quite hard for you to figure out, due to the fundamental way this is different to HTML (which is partly the point of this test being first, as it is such as big difference and had me stumped for ages). If you knew Flex already, it should have been a walk in the park.

Incidentally, does anyone have any feedback on these tests? Do you want me to publish any more?

Flex 2 Puzzle No 1

Posted by Neil on June 06, 2006

OK, I'm going to be setting a few little tests that I have found difficult while picking up Flex in the hope that the knowledge will spread outwards. Every now and then, one of these puzzles will appear. Just don't expect to win anything.

So, here's puzzle No 1:

- Using the feed-squirrel webservice (details at http://www.feed-squirrel.com/webservices/fswsdl.htm) create a combo box that contains the category's available, with the data being the category ID and the label being the name. You can use mx:WebService or mx:RemoteObject, I don't mind.

Now, admittedly if you know Flex this will be easy, but if you don't it can be quite tricky (but enlightening).

Game on.

UPDATE: Yup, I forgot the crossdomain.xml. Schoolboy error on my part. Thanks to Kevin Hoyt for pointing it out.

Tees for the people

Posted by Neil on June 05, 2006

OK, maybe not for everyone, but a few days ago I got playing with Zazzle, an on-line tee store where you can make your own and sell them online.

So, after a few minutes I came up with the following. As far as I know you can buy these in any style, colour and size, and if response is any good, I may just make more.


I love Web 1.0

Eat My Nuts

Don't Panic,
I speak fluent geek

Don't Panic,
I'm a programmer

“i”

Retrospectively installing ODBC services in Coldfusion MX 7 1

Posted by Neil on June 02, 2006

If, when you installed your copy of Coldfusion, did you choose not to include the ODBC Server and Agent services, you may find yourself in a position where you need to include them in your install. Well, you'll be please to know that it is indeed possible.

However, don't try this in CFMX 7, regardless of the above Adbobe Technote. The SequeLink Setup\Setup.exe included with CFMX 7 appears to be that of the CFMX 6.1 install, and running it will only try and do the 6.1 setup (which doesn't work in CFMX 7 of course).

So, the alternatives? Unfortunately, it appears only a reinstall of the server (selecting to include the ODBC services) is the way to go.

If anyone else knows how to do it without a reinstall, please let me know.