Our Blog

With the release of flash 6, we started hearing about the benefits of the RIAs, the marvels of a web application without refreshing, the "one page" interfaces, etc. By the time version 7 was released, Flex and Lazlo (ok, Lazlo was first) began to show the advantages of developing a RIA without the flash IDE. Now we have NeoSwiff (in beta), Xamlon (in Beta), Ajax (in JavaScript), xul (from Mozilla foundation), etc.

On the other hand, there exists the cool concept of a widget, a mini-application that sits on the desktop. Apple will introduce widgets with Dashboard when it releases Tiger in a few days. But this is not something new, Konfabulator (which works on Mac and PC) and others have previously implemented them. But widgets are not limited to the desktop, a small RIA can also be called a widget: etrade made a good one in flash 6, xamlon made a calculator and Lazlo made a weather app. In this way, the concept of a RIA and a widget are related.

With the introduction of Flash Forms, ColdFusion now gets into the party. Flash forms’ primary goal is to enhance regular html forms, that is why they are called rich forms (and not rich internet applications). However, we can create small internet app or widgets with them. I called them small because they have limitations and we cannot make big applications with them.

I’ve made two CFwidgets that are built with cfforms only. The first one is CF Weather. It uses a cfc to pull the data from weather.com. You can add your zip code or your city and it will remember your information in a cookie.

The other one is CF Calculator, a simple app, but very easy to extend to handle other functions such as square root.

CF widgets Weather

CF widgets Calculator

View CF Weather in action.
View CF Calculator.
Download the weather.
Download the calculator.

Nahuel Foronda

Nahuel Foronda

32 Comments

  1. PaulH
    i was meaning to mention this but forgot....your weather widget can be used outside the US by using weathe.com's "code" for that city/weathe station. for example bangkok's code is THXX0002.
  2. Nahuel
    Yes, you can also input the city name and it will find it, or it will show possible options to choose if there is more than one city with the same name.
  3. Mike
    Argh, I'm trying to use this app because it looks very cool - I just can't seem to figure out the base path variable for the life of me. Is it the root of the directory on the file system, the root of the coldfusion mapping, or the root of the web server mapping?? My choices:

    /home/softball/
    /softball/ (coldfusion mapped directory)
    /softball/ (apache mapping)

    I've tried those 2, and neither work - but that's where the folder is, so I'm at a lost as for what it's expecting.
  4. Laura
    The path is the absolute path of the web folder as you see it from a browser. Say you have the following address:

    http://www.example.com/dir1/dir2/mypage.cfm

    and you want to have the weather app in mypage.cfm, then your basepath will be:
    /dir1/dir2/

    If that does not work, then the problem could be something else.
  5. jason
    very nice little app. one question...i cannot get it to load outside my local network. locally, it works great but when an external address calls the page i get 'movie not loaded'

    i signed up with weather.com so i have my own auth codes.

    any ideas?
  6. Laura
    jason,
    is it the same path whether you access it locally or from outside?
    ie: http://localhost/mydir/cfmpage.cfm
    and http://externaladdress/mydir/cfmpage.cfm
    would be the same path.



  7. jason
    yes, the path is the same...it's on my index.cfm page. trying to troubleshoot this last night, i discoved that it only is working on one machine in my local network. i found it odd that only the development workstation will properly display the app. no web files, web server, or cf server are running on that machine.

    maybe i have a base path issue?

    i'm a cf developer and i really like these cf flash forms but i'm disappointed in the long load times, especially for dynamic forms. the weather app loads pretty quickly, yet it is dynamic. what's the secret to get these cf flash forms to load in a reasonable amount of time? have you noticed long load times? if so, how have you been dealing with it?

    thanks

    jason
  8. jason
    problem solved. the issue was access to weather.cfm....users outside the local network did not have access to that file.

    thanks for your help and the cool little widget.

    any thoughts on flash form load times?

    jason
  9. Nahuel
    Something to look for is recompilation of the form. Make sure you are not generating a different form every time with cfif, loops or similar. Only loaded data should be dynamic.
    In addition, try not to use too many nested containers if possible, but I don't have a secret.
  10. Ian
    sigh. I am having issues getting CFWeather to run. I keep getting 'Expression Exception' errors: C:\WWWROOT\CFWeather\com\cfwidgets\weather.cfm : line 109 - Cannot find CFML template for custom tag flashCallCFC.

    I have tried settings baspath to C:\WWWROOT\CFWeather\, to http://devnet.devlab.net/cfweather/ and to /CFWeather/. Still the 'Expression Exception' error.

    Can anyone offer any insights?
  11. Roy F
    Hi,

    I am am trying to use CF weather, but keep getting the following error:

    Cannot find CFML template for custom tag flashCallCFC.
    ColdFusion attempted looking in the tree of installed custom tags but did not find a custom tag with this name.

    Any idea how I can fix this? thanks for any help.

    Regards,
    Roy F.
  12. manuel
    La aplicación es estupenda, pero aun no logro hacer que funcione localmente, uso cfmx 6.0, como webserver el integrado por cf, la estructura es la siguiente wwwroot\dir1\weather, he creado el mapa en el administrador direccionando a la carpeta com, pero obtengo el siguiente mensaje

    Error Occurred While Processing Request
    Local variable keys on line 190 must be grouped at the top of the function body.

  13. Hola Manuel,
    Para que ande es necesario que tengas ColdFusion MX 7, ya que las cfforms que uso solo estan disponibles en la version 7
    Saludos
  14. manuel
    Muchas gracias Nahuel, por tu respuesta tan rapida, ya nada mas me queda felicitarte por tremenda aplicación, tendras idea que como lograr algo similar que funcione en la version o 6.1, estamos desarrollando un administrador de contenidos para la empresa que laboro y me gustaria realizar alguno (o en su defecto conseguir) para montarlo en el sistema....Nuevamente gracias
  15. Manuel,
    En CF 6.0 es imposible. Lo unico que se me ocurre es que lo hagas con puro flash y uses CodFusion para obtener la data ( pero de esta forma tardarias mucho mas en el desarrollo).
    Lo mejor es que instales el coldFusion 7 :)
  16. Joe Falletta

    Joe Falletta

    Hi,

    I am am trying to use CF weather, but keep getting the following error:

    Cannot find CFML template for custom tag flashCallCFC.
    ColdFusion attempted looking in the tree of installed custom tags but did not find a custom tag with this name.

    Any idea how I can fix this? thanks for any help.

    Regards,
    Joe F.
  17. Dale M.

    Dale M.

    Hi,

    I am having the same problem with the custom tag error "Cannot find CFML template for custom tag flashCallCFC". I'm pretty sure that the absolute path is set correctly.

    Anyone have an answer to this problem?

    Dale M.
  18. Joe F.
    Hello all,
    To those that had same problem I had, the custom tag error "Cannot find CFML template for custom tag flashCallCFC". The fix is easy, take files in the "cfwidgets" directory, not the com/cfwidgets but the plain cfwidgets directory and copy/paste them into your route install of CFMX in the "CustomTag" directory. Having doing that all worked OKay
  19. Jet
    What would be the calling template for the basePath? I understand what you mean by the absulute path but I need to know what the base template if refering too. Take care and have a great day.
  20. James
    Has anybody got a solution or BETTER instructions for setting up this app. I see loads of questions regarding this error result after an attempted set up: "Cannot find CFML template for custom tag flashCallCFC."
    <br><br>
    Here's my set up:
    <br><br>
    http://localhost:8500/cfweather/index.cfm
    <br><br>
    I click "View CF Weather" but I get the above error.
    <br><br>
    http://localhost:8500/cfweather/weather.cfm
    <br><br>
    <cfmodule template="/com/cfwidgets/weather.cfm" locationid="92660" units="s" ignorecookie="false" serviceObject="#application.cfwidgets.weather.service#" basePath="/">
    <br><br>
    What URL do I need in the basePath?
    <br><br>
    Also I have added a mapping called /com pointing to com directory.

    Can someone please help me set this up? :)

    Thanks
  21. James
    O.k. I followed the fix posted by Joe F. and it works. Thanks Joe. :)

    Seems like an easy enough addition to the readme.txt for those having the same trouble.
  22. John Barrett
    WOW Laura,
    This is so wonderful`-`
    Finally got this to work, did not know I had to set up cftags in the cfadmin(mappings). cool that I got to learn that tonight.
    Just wondering the settings do not seem to work. I did sign up for my own IDs through weather.com.

    Thanks so much for sharing this`-`
    Aloha,
    John
  23. Panos
    I get the following error when i try to view the weather.cfm.
    Any comments?



    Element conditions is undefined in a CFML structure referenced as part of an expression.

    The error occurred in F:\inetpub\intranet\www\demo\include\ermesintranet\cfweather\com\cfwidgets\weather.cfc: line 228
    Called from F:\inetpub\intranet\www\demo\include\ermesintranet\cfweather\com\cfwidgets\weather.cfm: line 39
    Called from F:\inetpub\intranet\www\demo\include\ermesintranet\cfweather\com\cfwidgets\weather.cfm: line 1
    Called from F:\inetpub\intranet\www\demo\include\ermesintranet\cfweather\com\cfwidgets\weather.cfm: line 1
    Called from F:\inetpub\intranet\www\demo\include\ermesintranet\cfweather\weather.cfm: line 11

    226 :       
    227 : <cfscript>
    228 :    if ( weatherData["conditions"] NEQ "N/A" ) {
    229 :       data = data & '<font size="16" face="#font#" color="#fontcolor#" ><b>' &weatherData["conditions"] & "</b></font><br/><br/>";
    230 :    }
  24. j.martin

    j.martin

    I've been running the weather widget for over a year with no problems. This week it started throwing the "Element conditions is undefined in a CFML structure referenced as part of an expression." error mention in an earlier post.

    Any ideas?
  25. Jeremy

    Jeremy

    I am having the same issue as j.martin and Panos. Can someone please help?
  26. Jeremy

    Jeremy

    I am having the same issue as j.martin and Panos. Can someone please help?