Andrew Powell

Into The Mind of A Solutions Architect

Andrew Powell

Entries Tagged as JSON

AIR CSS Reference Released

November 30, 2007 · 1 Comment

Those developing AIR applications in HTML/JavaScript know that the engine that enables these applications is WebKit. Apple has just released a CSS reference for Safari and WebKit. Since AIR is powered by WebKit, this, in turn, also applies to AIR Applications. Explanation of Terms Supported CSS Properties

1 CommentTags: Adobe · AIR · AJAX · Apple · General · JSON · Spry · Universal Mind · XML

CFUnited 2007 Slides

July 03, 2007 · No Comments

I thought I had included my slides in the previous CFUnited post, but I guess I didn't. What can I say? It was a long week. I have my own thoughts on CFUnited and how it went this year, but will save those for later until I've had time to fully process them and can articulate them in a plain and clear manner.

No CommentsTags: Adobe · AJAX · ColdFusion · Conferences · General · JSON · Speaking · Spry · XML

E4X or JSON?

June 15, 2007 · 5 Comments

OK, I just got done with the last day of Flex Training. The last topic we covered was E4X. I have to say, after drinking the JSON Kool-Aid, I'm still not convinced that XML is the way go.

[Read more →]

5 CommentsTags: Adobe · AIR · Flex · General · JSON · XML

Spry Autosuggest with JSON Dataset

May 23, 2007 · 16 Comments

Ray and I were chatting about Spry autosuggests earlier today and were wondering if the autosuggest would work with a JSON dataset in lieu of a XML dataset. We figured there was no reason why it shouldn't, if it acts like a regular dataset. So I set off on a mission to figure out if it would work. It does. With apologies to Ray, I borrowed the basis of his code to do my own autosuggest sample: <link href="/assets/css/SpryAutoSuggest.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="/assets/js/spry/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="/assets/js/spry/SpryData.js"></script>
<script language="JavaScript" type="text/javascript" src="/assets/js/spry/SpryAutoSuggest.js"></script>
<script language="JavaScript" type="text/javascript" src="/assets/js/spry/SpryJSONDataSet.js"></script>
<script>
var dsTeams = new Spry.Data.JSONDataSet("getJSON.cfm");
</script>
<style>
.highlight   {
   background-color: yellow;
}
</style>
<div id="mySuggest">
   Start typing a player's name to activate the autosuggest: <br/>
   <input type="text" name="search" />
   <div id="resultsDIV" spry:region="dsTeams">
      <span spry:repeat="dsTeams" spry:suggest="{column0}">{column0}<br /></span>   
   </div>
</div>

<script type="text/javascript">
var theSuggest = new Spry.Widget.AutoSuggest("mySuggest","resultsDIV", "dsTeams","column0",
{hoverSuggestClass:'highlight',minCharsType:2,loadFromServer:true,urlParam:'input',containsString:false});
</script>
UPDATE: Here is the code for the JSON Generator: <cfparam name="input" default=""/>

<cfquery datasource="demos" name="players">
SELECT name FROM players WHERE name LIKE '#URL.INPUT#%' ORDER BY name
</cfquery>

<cfset jsonService = createObject('component','autoSuggestWithJSON.json')/>

<cfset retArray = arrayNew(1)>
   
<cfloop query="players">
   <cfset arrayAppend(retArray,players.name)/>
</cfloop>

<cfcontent type="application/json">
<cfoutput>#jsonService.encode(retArray)#</cfoutput>
Working Sample

16 CommentsTags: Adobe · AJAX · ColdFusion · JSON · Spry

Spry Survey: What Part Intrests You Most?

May 09, 2007 · 2 Comments

This is a quick little informal survey... Leave your response in the comments. Of the three main elements of Spry, which intrests you (would you use) the most? XML & JSON Datasets
Widgets
Effects
A Combination of All Three

2 CommentsTags: Adobe

Another Vote For JSON over XML

May 09, 2007 · No Comments

By now, anyone who reads this know how much I really like JSON and how much I am becoming less and less enamoured with XML. I just ran into a problem where XML was the problem. A client had data stored in a cookie as encrypted and encoded XML (not WDDX) and it was just too big for the browser to handle. The cookie ended up being truncated and just got messy. I made a quick (less than five minute) conversion from storing as XML to storing as JSON. Poof, all the issues went away. The savings? The JSON string uses less than half the space than the XML. See, I told you JSON is more efficient. XML, your days are numbered.

No CommentsTags: AJAX

Spry Survey: What Part Intrests You Most?

May 09, 2007 · 2 Comments

This is a quick little informal survey... Leave your response in the comments. Of the three main elements of Spry, which intrests you (would you use) the most? XML & JSON Datasets
Widgets
Effects
A Combination of All Three

2 CommentsTags: AJAX

"But It Passed Unit Testing!"

May 09, 2007 · 1 Comment

I got bit by this one late yesterday. I was pounding my head against a wall about a problem I was having. A VO I was working with passed all it's unit tests. However there was combination of methods, when used, that were causing the VO to not function properly. The root cause was that the values of the VO were being saved in a cookie and the cookie was getting too big. Hence CF chokes on it and it the operation fails. (The data was being stored as XML. Changed it to JSON and we save tons of space, but that's another story.) The point, however, was this: Just because an element passes your unit tests does not assure you that it will pass integration testing. There are always variables outside of your unit tests that you cannot count on.

1 CommentTags: ColdFusion

Another Vote For JSON over XML

May 09, 2007 · No Comments

By now, anyone who reads this know how much I really like JSON and how much I am becoming less and less enamoured with XML. I just ran into a problem where XML was the problem. A client had data stored in a cookie as encrypted and encoded XML (not WDDX) and it was just too big for the browser to handle. The cookie ended up being truncated and just got messy. I made a quick (less than five minute) conversion from storing as XML to storing as JSON. Poof, all the issues went away. The savings? The JSON string uses less than half the space than the XML. See, I told you JSON is more efficient. XML, your days are numbered.

No CommentsTags: ColdFusion

"But It Passed Unit Testing!"

May 09, 2007 · 1 Comment

I got bit by this one late yesterday. I was pounding my head against a wall about a problem I was having. A VO I was working with passed all it's unit tests. However there was combination of methods, when used, that were causing the VO to not function properly. The root cause was that the values of the VO were being saved in a cookie and the cookie was getting too big. Hence CF chokes on it and it the operation fails. (The data was being stored as XML. Changed it to JSON and we save tons of space, but that's another story.) The point, however, was this: Just because an element passes your unit tests does not assure you that it will pass integration testing. There are always variables outside of your unit tests that you cannot count on.

1 CommentTags: General