I know I've been posting alot about Spry lately, but the more I use it, the more I love it! Using the simple-to-implement tools which Spry provides, I am able to spend more time dealing with server-side processing, rather than fighting javascript to get a couple of cool effects.
A few weeks ago, I blogged about using Spry to return confirmation or error messages for a registration form asychronously to alert users to possible errors in their form BEFORE submission.
Today's example is based on the same principle, although more of an "independant app." A week ago, a co-worker and I were talking about the idea of placing a "feed reader" inside of a web page, so that users could not only display links to feeds that they follow, but also allow for the feed to be displayed directly in the page. After our conversation, my thoughts immediately turned to Spry as I was sure a quick, easy solution would be possible.
I was right.
There is really nothing to this. In classic Spry usability-friendliness, this can be accomplished in about two lines of code:
The first line creates a Spry dataset--dsFeeds--which is populated from an invocation of the method "updateFeed" which is remotely exposed from my component.
The second line's method, "getFeeds", takes one argument, the url passed from the first dataset, and returns a nice xml string for Spry to play with.
Now the second part of this threw me for a bit of a loop. Originally, I was only passing the url to the method--but nothing was happening. ColdFusion would return the xml data, but it was not exposed for Spry to use. I banged my head for several minutes, double-checking code here and there, unable to find the problem. Then I remembered what the problem was.
AJAX calls are localized; they cannot be made across servers. So while I was passing the right argument to my method, the information that was returned was non-local, and was therefore not exposable to Spry. Luckily, ColdFusion created an easy solution. I simply passed the original URL argument to <cfhttp>
and saved the result to a variable. I then dealt with this (now local) variable in the normal way, returned it to Spry, and voila! it worked. I will not forget that again!
Anyway, that's about enough for that. I have souped this up a little bit, just to show the flexibility which Spry provides. In this example, the application starts with zero Feed Entries, and the user is required to populate a list. When the appropriate addFeed() function is fired, a session structure is created to hold the values, as well as any others that are created in the future. Obviously, the same could be easily refitted for a database, hard-coded XML files, etc., but I like this one because it really shows off how interesting Spry can make a website.
As a disclaimer, while I have enhanced a bit of the functionality, there is much that is glaringly missing. I have no validation for proper URL's, no regex's for wierd URL characters, etc., so it should not be incredible difficult to break immediately if one is so inclined. Also, there is a bit of a quirk with the way the session structure sorts the entries. So yeah, there are issues. However, I think those interested in Spry will see the promise that even such a ridiculously simple example engenders.
See the example here .
I know I've been posting alot about Spry lately, but the more I use it, the more I love it! Using the simple-to-implement tools which Spry provides, I am able to spend more time dealing with server-... [more]
And He who sits on the throne said, "Behold, I am making all things new."
In an age in which global warming, climate change and concerns about the viability of our planet's environment ar...
[more]
Just a quick reminder: blogactionday (October 15) is approaching rapidly--next Monday! This is a day where bloggers are encouraged to devote a posting to the environment, regardless of their views o... [more]
On the whole, I tend to be fairly loyal in media technologies. I do what I can to support Adobe --I use ColdFusion, the more]
Within the last six months, my little brother has introduced me to some seriously cool music. One of my favorite bands from this "education" is Emery, a hard-hitting "screamo" band hailing from the ... [more]
A few days I blogged about Adobe's release (and sexy-fication) of the javascript framework Spry 1.6. While I have not had a lot of time to play around with the absolutely unique elements, some cool ... [more]
Over the last week, I have rolled through several chapters of Peacocke's book, "Theology for a Scientific Age," and I will not spend time going over the finer details of each discussion. I simply wi... [more]
Recently, I have blogged about how incredibly cool Adobe's javascript framework---Spry---is and what potential it has for making great dynamic web content. In those posts, I was talking about Spry p... [more]
Growing up in the Wesleyan Church, I've not had tremendously moving experiences with the celebration of communion. In the Wesleyan Church--as in many others--communion is served (by Discipline requi... [more]
Since their self-titled debut in 2000, Rascal Flatts has consistently and with ever-growing force become a presence within the country-pop crossover music scene to be reckoned with. Boasting such awa... [more]
Welcome to my blog. I am often asked what "Exist/Dissolve" means. Well, that is certainly a good question, and I am currently in the process of discovering the answer myself. Prima facie, it strikes me as encapsulating the existensial crisis that is our lives as finite, contingent beings. For a brief moment, we exist, and the next we dissolve into the nothingness of non-existence. From a theological perspective, it is, for me, a sort of ad hoc apologetic for resurrection - i.e., if to exist/dissolve is the human dilemma, there is nothing inherent to the person that guarantees existence, either now or "after" death. Therefore, resurrection is at the same time both the height of absurdity (for it is a notion entirely alien to the paradigm of existence to which we are naturally enculturated) and the only hope for the human to persevere beyond the pale of death.
| deviant monk | |
| mofast-manna | |
| reformed mafia | |
| rose's reasonings | |
| Shawn Dones | |
| scribe |
0 comments logged
Please login to leave a comment