jqGrid

Suddenly, I saw jqGrid when I was browsing Coldfusion RIA documentation. GUI is incredible nice but I prefer Flash-based GUI like RIA application.

Read more here : http://www.trirand.net/demophp.aspx

Coldfusion flash Cfform

It's my first so-called test form using with Coldfusion cfform flash. I feel it's nice design like RIA and very comfortable to our clients. Because, it's one of the best GUI I've ever developed in my programming life stream. If I can do the whole project like that, I bet our application will be one of the best GUI applications and user-familiar applications for sure.

I've used some reference from AsfusioRIA with Coldfusion

Coldfusion Webservices and JSON

I've recently tested CF web services and JSON. The outcome is incredible. Because, I'm very new to JSON and CF web services. That's why I'm very proud of myself what I did. That's what I want to do in Myanmar about synchronization two web applications over the internet for sharing data. In these testing, I've also used Coldfusion ajax submitForm. In briefly, when user type, then will be displayed JSON format. I've got some JSON knowledge from Ben Nadel blog. getJSON.cfc

view plain print about
1<cfcomponent output="false">
2<cffunction name="jsonData" access="remote" returntype="array" returnformat="json" output="false" hint="Return JSON Format Data">
3<cfargument name="Text" type="string" required="true">
4<cfset getJ = ArrayNew(1)>
5<cfloop from="1" to="#ListLen(Text, " ")#" index="i">
6<cfset getJ[i] = ListGetAt(Text, i, " ")>
7</cfloop>
8<cfreturn getJ>
9</cffunction>
10</cfcomponent>
get.cfm
view plain print about
1<html>
2<head>
3<cfajaximport>
4<invalidTag>
5function submitForm() {
6ColdFusion.Ajax.submitForm('myform', 1, 'formAction.cfm', 1, callback,
7errorHandler);
8}
9function callback(text)
10{
11document.getElementById("divShowMsg").innerHTML = text;
12}
13function errorHandler(code, msg)
14{
15alert("Error!!! " + code + ": " + msg);
16}
17</script>
18</head>
19<body>
20<div id="divShowMsg"></div>
21<cfform name="myform">
22<cfinput name="mytext1" size="50">
23<input type="Button" onclick="submitForm()" value="WebServices JSON ">
24</cfform>
25</body>
26</html>
formAction.cfm
view plain print about
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<title>Untitled</title>
5</head>
6<body>
7<cfinvoke webservice="http://localhost/webservices/getJSON.cfc?wsdl" method="jsonData" returnvariable="strg">
8<cfinvokeargument name="Text" value="#form.mytext1#" />
9</cfinvoke>
10<cfdump var="#strg#">
11</body>
12</html>

JSStringFormat

Before time when I want to display warning message (including single-quote, double quote and so on) in Javascript Alert, it's complicate to write more than one line and which mess me up. Once I know JSStringFormat, everything what I want to do concerning javascript's message are very simple. If you want to output the string (including single-quote, double-quote and so on), use JSStringFormat. Here you go:

view plain print about
1<cfset myString = "this is ppshein's blog. ""That's cool""">
2<cfset jsStringFormatted = JSStringFormat(myString)>
3<invalidTag>
4alert("<cfoutput>#jsStringFormatted#</cfoutput>");
5</SCRIPT>

jqTouch and jqPlot

When I browse my twitter this morning, I've found two amazing jQuery cores tweeted by Raymond Camdem. These are called jqTouch and jqPlot. jqTouch stands for mobile development for iPhone, iPod and iPad. It's just for only mobile web development, not for mobile application development. jqPlot stands for charting. It's not that much cool like jqTouch. Because Coldfusion already supports Charting and which can be integrated with 3rdparty application like WebCharts3D. After browsing jqPlot, I feel onClick event is missing in these core function. I think it will be included in next version or let me know if you found these event in it.

RepeatString

The more I know of Coldfusion, the more I know Coldfusion has so many core function even some web technology programming cannot do. When I wanna to display one word to be repeated into paragraph or somewhere else, I might use or or something else. Once I know that function called RepeatString, all old-fashioned idea are gone. Because it's very easy and simple to use it.

view plain print about
1<!---
2    RepeatString([string], [count which means how many time wanna repeat])
3--->

4<cfset myRepeatString = RepeatString("ppshein - ", 5)>

cfdump

Today, my senior told me to display user login name in cfml page. But, he didn't mention which client variable is stored as login name. That's why I'm dilemma and how to know how many client variables have been stored in our system. So, I think I need to use cfdump to display what I want. Cool..!! It can display client variable name and value which have been used in our system.

view plain print about
1<cfdump var="#client#">
2<cfdump var="#session#">
3<cfdump var="#application#">

ListQualify

ListQualify is one the most useful function for list in CFML. Before my time, I always needed to write some various codings and comparison statement when I need list value between single quote in each like 'pps', 1, 'coldfusion', 1, 'programmer'. Once I know ListQualify, it's quite easy with single statement. Function syntax

ListQualify(list, qualifier [, delimiters ] [, elements ]) list = data come from Query or something else qualifier = the symbol which you wanna insert beginning and end of list delimiters = the delimiter of your list element = ALL or CHAR

Here is example

view plain print about
1<cfquery name = "myQry" datasource="myDSN">
2    SELECT Name FROM tblName ORDER BY VACCINATION_CODE
3</cfquery>
4<!--- Add data into list from query --->
5<cfset myList = ValueList(myQry.Name)>
6<cfoutput>
7    <p>It's orginal list: </p> #myList#
8</cfoutput>
9<!--- Inserting sybmol at the beginning and end of list --->
10<cfset qualifiedList1 = ListQualify(myList,"'",",","CHAR")>
11<cfoutput>
12<p>It looks alike with ListQualify: </p>
13<p>#qualifiedList1#</p>
14</cfoutput>

QuotedValueList

I didn't know how to make enclosed in single quote marks like 'pps', 1, 'ppshein', 1, 'coldfusion' between cfquery tag. It's quite simple to use this function. It's opposite of PreserveSingleQuotes and not like ListQualify because QuotedValueList works only in cfquery. ListQualify can be enclosed by any characters and can be displayed outside of cfquery.

Here is example from Adobe Docs

view plain print about
1<cfquery name = "GetCourseList" datasource = "cfsnippets">
2SELECT *
3FROM CourseList
4WHERE Dept_ID IN (#QuotedValueList(GetDepartments.Dept_ID)#)
5</cfquery>

Top of Page