Bruce Phillips Blog on Java, ColdFusion, Flex and Spry - Flex /blog/index.cfm Tutorials on using Java, ColdFusion, Flex, and Spry en-us Tue, 15 Nov 2016 07:21:35 -0700 Sun, 19 Dec 2010 16:19:00 -0700 BlogCFC http://blogs.law.harvard.edu/tech/rss Bruce@Phillips.name Bruce@Phillips.name Bruce@Phillips.name Bruce Phillips Blog on Java, ColdFusion, Flex and Spry /blog/index.cfm no Using BlazeDS Version 4 To Integrate A Flex Application With A Java Backend Built With Flash Builder /blog/index.cfm/2010/12/19/Using-BlazeDS-Version-4-To-Integrate-A-Flex-Application-With-A-Java-Backend-Built-With-Flash-Builder <p><strong>Introduction</strong></p> <p>Adobe and SpringSource are working together to make it easier for Java developers to use Java and Spring on the backend and Flex-Adobe's rich internet application framework [<a href="#FlexOverview">refer 2</a>]--on the frontend.&nbsp; Adobe has an open source project called BlazeDS [<a href="#AdobeOpenSourceBlazeDS">refer 8</a>] that provides the plumbing to enable a Flex application to communicate data with a Java application running on a server.&nbsp; The new version of the Flex IDE--Flash Builder 4 [<a href="#AdobeFlashBuilder4">refer 3</a>]--provides extensive data wizards that can auto detect the services a Java application is exposing to a remote application such as the Flex client.&nbsp; SpringSource has created a Spring Flex module [<a href="#AnintroductiontoSpringBlazeDSintegration">refers 1 and 6</a>] that enables Java developers to use Spring to set up the BlazeDS plumbing on the server side and to use XML or annotations to mark which classes and methods should be available to be called by the Flex application.</p> [More] Flex Java Sun, 19 Dec 2010 16:19:00 -0700 /blog/index.cfm/2010/12/19/Using-BlazeDS-Version-4-To-Integrate-A-Flex-Application-With-A-Java-Backend-Built-With-Flash-Builder Using BlazeDS to Connect Flex to A Java Class That Returns Data From A Database /blog/index.cfm/2008/6/25/Using-BlazeDS-to-Connect-Flex-to-A-Java-Class-That--Returns-Data-From-A-Database <h3>Introduction</h3> <p>This is part 4 in my series on using Flex, BlazeDS, and Java. In this part I explain how I used Java to provide my Flex application with a collection of objects that were populated by records from a database. BlazeDS provides the plumbing that enables Flex to communicate with the Java classes on the back end. If you've not yet read the previous posts in this series, you should <a href="/blog/index.cfm/2008/6/22/Using-Flex-BlazeDS-and-Java-Together--A-Simple-Tutorial" target="_blank">review them</a> first.</p> <h3>Steps to Set Up This Example</h3> <p>You can <a href="http://www.bpjava.net/blazeds/Test5BlazeDS/Test5BlazeDS.html" target="_blank">view this example</a> online. Right click on the application to view the source code.</p> <p>I created a series of Java classes that connected to my database, executed a query, and iterated over the result set. For each record I created a Speaker object (Speaker is a separate class with firstName, lastName, and title instance fields). Each Speaker object is added to an ArrayList, which is returned to the caller.</p> [More] Flex Java Wed, 25 Jun 2008 07:18:00 -0700 /blog/index.cfm/2008/6/25/Using-BlazeDS-to-Connect-Flex-to-A-Java-Class-That--Returns-Data-From-A-Database Using BlazeDS to Send User-Defined Data Types (Data Transfer Objects) from Java to Flex /blog/index.cfm/2008/6/23/Using-BlazeDS-to-Send-UserDefined-Data-Types-Data-Tranfer-Objects-from-Java-to-Flex <h3>Introduction</h3> <p>This is part 3 of my series on how to use BlazeDS to enable Flex to communicate with Java on the backend. If you've not yet read <a href="/blog/index.cfm/2008/6/22/Using-Flex-BlazeDS-and-Java-Together--A-Simple-Tutorial" target="_blank">parts 1 and 2</a>, you should review them before continuing. In this blog entry I'll explain how I created an example to have Java send a user-defined data type (a data transfer object) and a collection of user-defined data types to the Flex application.</p> [More] Flex Java Mon, 23 Jun 2008 21:49:00 -0700 /blog/index.cfm/2008/6/23/Using-BlazeDS-to-Send-UserDefined-Data-Types-Data-Tranfer-Objects-from-Java-to-Flex Using BlazeDS to Enable Flex to Send Data To A Java Class /blog/index.cfm/2008/6/23/Using-BlazeDS-to-Enable-Flex-to-Send-Data-To-A-Java-Class <h3>Introduction</h3> <p>This blog entry continues my exploration of how to use Flex, Java, and BlazeDS together. In this tutorial I explain how to send data from Flex to a Java class.</p> [More] Flex Java Mon, 23 Jun 2008 20:41:00 -0700 /blog/index.cfm/2008/6/23/Using-BlazeDS-to-Enable-Flex-to-Send-Data-To-A-Java-Class Using Flex, BlazeDS, and Java Together - A Simple Tutorial /blog/index.cfm/2008/6/22/Using-Flex-BlazeDS-and-Java-Together--A-Simple-Tutorial <h3>Introduction</h3> <p>When you want to directly use Java classes to provide data to a Flex application you need to add some additional plumbing that enables Flex to &quot;talk with&quot; the Java classes. Flex comes ready to rock with ColdFusion Components, but doesn't have everything it needs to communicate directly with Java classes exposed by a J2EE or servlet container such as Tomcat. </p> [More] Flex Java Sun, 22 Jun 2008 14:07:00 -0700 /blog/index.cfm/2008/6/22/Using-Flex-BlazeDS-and-Java-Together--A-Simple-Tutorial Handling ColdFusion Custom Exceptions In Flex /blog/index.cfm/2008/4/27/Handling-ColdFusion-Custom-Exceptions-In-Flex <h3>Introduction</h3> <p>There may be occasions when a CFC function being used by Flex needs to throw a custom exception to alert the caller of the function that some problem has occurred during the function (1). If you're using Flex to call a CFC function that may throw an exception then you need a way to handle the exception in Flex (6) and display an appropriate error message to the user. This blog entry desribe a technique I use to throw an exception from a CFC function and then display an exception message in Flex to the user. Flex automatically translates the attributes of the ColdFusion cfthrow tag (3) to property values of the Flex Fault class (8).</p> [More] Flex Sun, 27 Apr 2008 10:55:00 -0700 /blog/index.cfm/2008/4/27/Handling-ColdFusion-Custom-Exceptions-In-Flex Flex - Printing A DataGrid That Spans Multiple Printed Pages /blog/index.cfm/2008/4/11/Flex--Printing-A-DataGrid-That-Spans-Multiple-Printed-Pages <h3>Introduction</h3> <p>I recently needed to add a print capability to a Flex application to allow the user to print the results being displayed in a DataGrid control. The print out would need to span multiple pages since the number of rows displayed in the DataGrid exceeds the height of one printed page. Not having had to print a DataGrid's content before I consulted the Flex 3 documentation. The developer's guide (1,2) provides a good explanation of how to print (1) and shows an example of how to print a DataGrid that will span multiple pages (2). However, the multipage example (2) is a bit complex, has some convoluted logic (uses an endless loop) and is hard to follow since it makes use of several custom components to provide a header and footer to the printed pages. So I thought a simpler example and explanation of just printing the DataGrid on multiple pages might be beneficial.</p> [More] Flex Fri, 11 Apr 2008 07:59:00 -0700 /blog/index.cfm/2008/4/11/Flex--Printing-A-DataGrid-That-Spans-Multiple-Printed-Pages An Introduction to Integrating ColdFusion, ColdSpring, and Flex 3 /blog/index.cfm/2008/3/25/An-Introduction-to-Integrating-ColdFusion-ColdSpring-and-Flex-3 <p>I am presenting how to use ColdFusion, ColdSpring, and Flex together to the Kansas City Adobe RIA User Group on March 25, 2008. ColdSpring is a framework that helps developers manage the dependencies between ColdFusion Components (CFCs). ColdSpring has a feature that enables it to create a remote facade for any of the CFCs that it manages. A Flex application can connect to the remote facade CFC to get data, save information, or to perform other server side operations. My presentation provides an introduction on how to use ColdSpring to manage dependencies and how to enable ColdSpring to create remote facade CFCs. </p> <p>Using the links below you can download a copy of the presentation and the example projects. In the first part of the presentation, I explain how to setup the example projects and the database they use.</p> [More] Flex ColdFusion Tue, 25 Mar 2008 09:06:00 -0700 /blog/index.cfm/2008/3/25/An-Introduction-to-Integrating-ColdFusion-ColdSpring-and-Flex-3 Displaying Grouped Data Provided By ColdFusion in the Flex 3 AdvancedDataGrid /blog/index.cfm/2008/3/16/Displaying-Grouped-Data-Provided-By-ColdFusion-in-the-Flex-3-AdvancedDataGrid <h3>Introduction</h3> <p> ColdFusion makes it easy to display query results grouped by one of the query result columns on a web page. You just need to use the group attribute (1) of the cfoutput tag. Showing grouped data that was provided by a ColdFusion query in Flex 2 was not so easy. However, with the introduction of the AdvancedDataGrid component (2) in Flex 3, it's now simple to showed grouped data that initially came from a ColdFusion query.</p> [More] Flex Sun, 16 Mar 2008 08:16:00 -0700 /blog/index.cfm/2008/3/16/Displaying-Grouped-Data-Provided-By-ColdFusion-in-the-Flex-3-AdvancedDataGrid XML And The Flex LinkBar's DataProvider Attribute /blog/index.cfm/2008/3/9/XML-and-the-Flex-LinkBars-DataProvider-Attribute <p>I was recently working on a Flex project where I wanted to use the LinkBar component (1). However, the data I needed to use that included the label values for the LinkBar's LinkButtons was in an XML file. As best I can tell, the LinkBar component is one of the few Flex components whose dataProvider attribute doesn't accept XMLList or XMLListCollection. According to reference 2, the dataProvider value for a LinkBar component must either be a ViewStack component or an array.</p> [More] Flex Sun, 09 Mar 2008 09:34:00 -0700 /blog/index.cfm/2008/3/9/XML-and-the-Flex-LinkBars-DataProvider-Attribute Using The New Yahoo! Maps ActionScript 3 API - Create A SearchMarker Using Your Own Data /blog/index.cfm/2008/2/14/Using-The-New-Yahoo-Maps-ActionScript-3-API--Create-Your-A-SearchMarker-Using-Your-Own-Data <p>The Yahoo! maps AS3 API provides a <a href="http://developer.yahoo.com/flash/maps/classreference/com/yahoo/maps/api/markers/SearchMarker.html" target="_blank">SearchMarker class</a> that is used to display on the map an icon representing a <a href="http://developer.yahoo.com/flash/maps/classreference/com/yahoo/maps/webservices/local/LocalSearchItem.html" target="_blank">LocalSearchItem class</a> object. The LocalSearchItem class is used to store data contained in a result returned from searching the Yahoo! Local listings (see the related entry below). This data includes phone, address, website, title, etc. However, you can create your own LocalSearchItem objects and use these objects to create SearchMarker objects and display those on the map. The <a href="http://developer.yahoo.com/flash/maps/classreference/com/yahoo/maps/webservices/local/LocalSearchItem.html" target="_blank">LocalSearchItem class documentation</a> is a bit confusing on how to create an object of the class, so I thought a blog entry and <a href="/flex/yahoomaps/yahoomapsex4/yahoomapsex4.html" target="_blank">example (right click on the app to view source code)</a> might be helpful. </p> [More] Flex Thu, 14 Feb 2008 13:16:00 -0700 /blog/index.cfm/2008/2/14/Using-The-New-Yahoo-Maps-ActionScript-3-API--Create-Your-A-SearchMarker-Using-Your-Own-Data Using The New Yahoo! Maps ActionScript 3 API - Creating A Custom Marker /blog/index.cfm/2008/2/12/Using-The-New-Yahoo-Maps-ActionScript-3-API--Creating-A-Custom-Marker <p>At the end of my previous post on the new Yahoo! maps AS3 API, I mentioned that I wanted to learn how to create my own custom Marker class so that I could display my own graphic and text on the map. After some playing around, I figured out how to create a custom Marker class. You can view an <a href="/flex/yahoomaps/yahoomapsex3/yahoomapsex3.html" target="_blank">example Flex application here</a> (right click to get the source code).</p> [More] Flex Tue, 12 Feb 2008 16:52:00 -0700 /blog/index.cfm/2008/2/12/Using-The-New-Yahoo-Maps-ActionScript-3-API--Creating-A-Custom-Marker Using The Yahoo! Maps ActionScript 3 API To Create A Map With Local Places - A Beginner's Tutorial /blog/index.cfm/2008/2/11/Using-The-Yahoo-Maps-ActionScript-3-API-To-Create-A-Map-With-Local-Places--A-Beginners-Tutorial <p>I was excited to learn that Yahoo! released an ActionScript 3.0 API for their maps service. I've just started to play with the API, but it looks relatively easy to use. I do wish there was a bit more developer's documentation. Since even after studying <a href="http://developer.yahoo.com/flash/maps/examples.html" target="_blank">the examples provided by Yahoo!</a>, I was confused on how to create a map and display places on the map (especially the results of doing a search on Yahoo! Local), I thought a beginner's guide might be useful for others. </p> <p>I've created a simple Flex application demonstrating how to create a map, place a SimpleMarker object on the map, and display the results of doing a search of the Yahoo! Local listings. You can <a href="/flex/yahoomaps/yahoomapsex2/yahoomapsex2.html" target="_blank">view the application and get its source code (right click on the application) here</a>. I tried to include some good comments in the source code to help you follow what I did. Here are the key steps:</p> [More] Flex Mon, 11 Feb 2008 23:00:00 -0700 /blog/index.cfm/2008/2/11/Using-The-Yahoo-Maps-ActionScript-3-API-To-Create-A-Map-With-Local-Places--A-Beginners-Tutorial The Grade Schooler's Guide To ColdSpring - Part 2 Flex To ColdSpring Connection /blog/index.cfm/2007/12/31/The-Grade-Schoolers-Guide-To-ColdSpring--Part-2-Flex-To-ColdSpring-Connection <h3>Introduction:</h3> <p>One of the web applications I'm developing for the Kansas City Adobe User Group uses a Flex front end. The backend CFCs are managed by ColdSpring (see <a href="/blog/index.cfm/2007/12/29/The-Grade-Schoolers-Guide-To-ColdSpring--Part-1-Naked-ColdSpring" target="_blank">part 1 Naked ColdSpring</a>). Since ColdSpring is managing the CFCs and their dependencies, I cannot just call my UserService CFC from Flex. My Flex application needs to connect to the UserService object being managed by ColdSpring, which has all of its dependencies resolved.</p> <p>ColdSpring provides a means to create a version of my UserService CFC that Flex can connect to. References 1 and 2 provide some advanced explanations of how to get ColdSpring to create a remote version of a CFC. This blog entry will provide the grade school version.</p> [More] Flex ColdFusion Mon, 31 Dec 2007 12:45:00 -0700 /blog/index.cfm/2007/12/31/The-Grade-Schoolers-Guide-To-ColdSpring--Part-2-Flex-To-ColdSpring-Connection Corrections To Flex Exchanging Data With ColdFusion Backend Posted on Adobe's Flex Developer Center /blog/index.cfm/2007/11/21/Corrections-To-The-Flex-Exchanging-Data-With-ColdFusion-Backend-Posted-on-Adobes-Flex-Developer-Cen <p>I was recently working my way through a Flex tutorial on exchanging data with a backend ( see: <a href="http://learn.adobe.com/wiki/display/Flex/Part+II.+Exchanging+Data" target="_blank">http://learn.adobe.com/wiki/display/Flex/Part+II.+Exchanging+Data</a>) provided by Adobe's Flex Developer's Center. The example in Adobe's tutorial uses the Flex HTTPService to consume XML produced by ColdFusion (there is also backend code for Java, ASP.net, and PHP provided). Unfortunately, there are some mistakes in the ColdFusion backend code that prevented me from getting the example using ColdFusion on the backend to work. I posted a comment about the problem to the page and pointed readers to this blog entry. </p> [More] Flex ColdFusion Wed, 21 Nov 2007 17:32:00 -0700 /blog/index.cfm/2007/11/21/Corrections-To-The-Flex-Exchanging-Data-With-ColdFusion-Backend-Posted-on-Adobes-Flex-Developer-Cen