<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Stephen&#039;s dev blog</title>
	<atom:link href="http://colourgray.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://colourgray.wordpress.com</link>
	<description>I heart javascript</description>
	<lastBuildDate>Thu, 19 Nov 2009 17:24:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='colourgray.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Stephen&#039;s dev blog</title>
		<link>http://colourgray.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://colourgray.wordpress.com/osd.xml" title="Stephen&#039;s dev blog" />
	<atom:link rel='hub' href='http://colourgray.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Magento create a custom payment method</title>
		<link>http://colourgray.wordpress.com/2009/11/11/magento-create-a-custom-payment-method/</link>
		<comments>http://colourgray.wordpress.com/2009/11/11/magento-create-a-custom-payment-method/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 09:42:18 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[payment]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=136</guid>
		<description><![CDATA[I&#8217;ve been doing some work with the Magento e-commerce platform lately and my task was to create a new payment method to use during the standard checkout process. I&#8217;ve come to the conclusion that Magento is very annoying to develop for if you know nothing about the platform. Yes the platform is open source but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=136&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some work with the Magento e-commerce platform lately and my task was to create a new payment method to use during the standard checkout process.</p>
<p>I&#8217;ve come to the conclusion that Magento is very annoying to develop for if you know nothing about the platform. Yes the platform is open source but they also have a commercial version, therefore it seems they have tried to make it hard for you to know the complete ins and outs of the system. I.E. if something seems like too much of a task to develop, a company would likely purchase the commercial version and get it developed by the platform developers rather than do it themselves.</p>
<p>You also have to remember that Magento is built on top of the Zend framework, so when you are developing for it documentation does not all reside on the Magento site, you will have to look into how the Zend framework works as well.</p>
<p>Finally, note that by default the Magento checkout process uses AJAX to submit the form, making this a very annoying module to debug. Thankfully Magento makes it easy to log values and throw exceptions which &#8216;pause&#8217; the checkout process.</p>
<p>After much searching online, it seems that any available tutorials for custom payment methods either don&#8217;t work, are incomplete or worked in previous versions but are now updated. I developed this using version 1.3.2.2 of Magento.</p>
<p>I&#8217;m writing this tutorial with the intention of it being the definitive guide to creating a custom payment method.</p>
<p>* You&#8217;ll notice that I&#8217;m using PHP comments in XML code snippets. This is because WordPress isn&#8217;t letting me post normal XML comments <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  You&#8217;ll have to change/remove them if you plan to copy and paste.</p>
<p><strong><a href="#0">Prerequisites</a></strong></p>
<p><strong><a href="#1">1. Creating the module</a></strong></p>
<p><strong><a href="#2">2. Configuration through the admin</a></strong></p>
<p><strong><a href="#4">4. Payment adapter model class</a></strong></p>
<p></p>
<h2><a name="0">Prerequisites</a></h2>
<p>
There are a few things you need to note now to avoid confusion later down the line.</p>
<p>For your module, you need the main name and a simpler alias for it. I.E. if your module was called MyPaymentMethod, your alias could be mypayment. Keep the full name and the alias in mind. The full name will be used in class and folder names but the alias will be used when referencing the module anywhere else.</p>
<p>For this tutorial I will be using ModuleName for the full name, modulename for the module alias, and MyModules as the module namespace.</p>
<p>Magento names it&#8217;s classes after their path. I.E. you are going to have a class which handles all of this payment method logic, and it&#8217;s path will be something like app/code/local/MyModules/ModuleName/Model/PaymentLogic.php. It&#8217;s class name will be MyModules_ModuleName_Model_PaymentLogic. Remember this as it helps when trying to figure out where to find a referenced class etc.</p>
<p></p>
<h2><a name="1">1. Creating the module</a></h2>
<p>
OK so first we need to create the initial module and make sure Magento knows that it exists. Lets create the folder structure;<br />
<code><br />
app/<br />
---- code/<br />
-------- local/<br />
------------ <strong>#1</strong> MyModules<br />
---------------- <strong>#2</strong> ModuleName<br />
-------------------- <strong>#3</strong> Block<br />
-------------------- <strong>#4</strong> etc<br />
-------------------- <strong>#5</strong> Model<br />
</code></p>
<p><strong>#1</strong> In Magento terms, MyModules would be the module&#8217;s namespace. I.E. you&#8217;ll likely have one namespace for multiple modules. The namespace can be called anything but should be UpperCamelCase. If you take a look in app/code/core you will see a folder called Mage &#8211; this is the namespace for most of Magento&#8217;s core modules.</p>
<p><strong>#2</strong> This is your actual module name. This should be UpperCamelCase.</p>
<p><strong>#3</strong> This folder is used to contain block classes that are used in your module.</p>
<p><strong>#4</strong> This is where your module configuration will go.</p>
<p><strong>#5</strong> The class that handles all of your payment gateway logic will go here. This is also a good place to put any third party libraries or custom classes you may use.</p>
<p><strong>config.xml</strong></p>
<p>Create the file config.xml in app/code/local/MyModules/ModuleName/config. This file is the main module configuration file. For now, you want it to look like this;</p>
<p></p>
<pre>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;config&gt;

    /**
     * register the full module name and it's
     * version
     */
    &lt;modules&gt;
        &lt;MyModules_ModuleName&gt;
            &lt;version&gt;0.1.0&lt;/version&gt;
        &lt;/MyModules_ModuleName&gt;
    &lt;/modules&gt;

    /**
     * global module configuration
     */
    &lt;global&gt;

        /**
         * register the module's model group
         * note that we use the module's alias
         * mentioned in the prerequisites
         */
        &lt;models&gt;
            &lt;modulename&gt;
                &lt;class&gt;MyModules_ModuleName_Model&lt;/class&gt;
            &lt;/modulename&gt;
        &lt;/models&gt;

        /**
         * set which resources the module will
         * use when setting up, writing to the db
         * and reading from the db. we're going
         * to use the core connections.
         */
        &lt;resources&gt;
            &lt;modulename_setup&gt;
                &lt;setup&gt;
                    &lt;module&gt;MyModules_ModuleName&lt;/module&gt;
                &lt;/setup&gt;
                &lt;connection&gt;
                    &lt;use&gt;core_setup&lt;/use&gt;
                &lt;/connection&gt;
            &lt;/modulename_setup&gt;
            &lt;modulename_write&gt;
                &lt;connection&gt;
                    &lt;use&gt;core_write&lt;/use&gt;
                &lt;/connection&gt;
            &lt;/modulename_write&gt;
            &lt;modulename_read&gt;
                &lt;connection&gt;
                    &lt;use&gt;core_read&lt;/use&gt;
                &lt;/connection&gt;
            &lt;/modulename_read&gt;
        &lt;/resources&gt;
    &lt;/global&gt;
&lt;/config&gt;
</pre>
<p>Now the module has it&#8217;s basic configuration but Magento doesn&#8217;t care because the module is not yet registered.</p>
<p><strong>MyModules_All.xml</strong></p>
<p>Create the file MyModules_All.xml in app/etc/modules. This is where we register the module. You want this file to look like this;</p>
<p></p>
<pre>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;
    &lt;modules&gt;
        &lt;MyModules_ModuleName&gt;
            &lt;active&gt;true&lt;/active&gt;

            /**
             * for now we're telling the system that
             * this module is just local, it's not a core
             * or community module and resides in
             * app/code/local.
             */
            &lt;codePool&gt;local&lt;/codePool&gt;
        &lt;/MyModules_ModuleName&gt;
    &lt;/modules&gt;
&lt;/config&gt;
</pre>
<p>The module is now registered and Magento knows about it. But what can you do with it? Well, this is a payment method module, so we need to register it as a usable payment method. We also need to be able to set what fields are configured in the administration section that can be used when authenticating with the payment gateway etc.</p>
<p></p>
<h2><a name="2">2. Configuration through the admin</a></h2>
<p>
<strong>system.xml</strong></p>
<p>Create the file system.xml in app/code/local/MyModules/ModuleName/etc. Here we will tell Magento to have a new section in the payment methods configuration area for configuring this module. We also set what fields we want there. For every field, we have an element like this;</p>
<p></p>
<pre>
&lt;field_name translate=&quot;label&quot;&gt;
    &lt;label&gt;Field name&lt;/label&gt;
    &lt;frontend_type&gt;field type&lt;/frontend_type&gt;
    &lt;source_model&gt;field source model class&lt;/source_model&gt;
    &lt;sort_order&gt;1&lt;/sort_order&gt;
    &lt;show_in_default&gt;1&lt;/show_in_default&gt;
    &lt;show_in_website&gt;1&lt;/show_in_website&gt;
    &lt;show_in_store&gt;0&lt;/show_in_store&gt;
&lt;/field_name&gt;
</pre>
<p>
As you will see below. To start with, have the file looking like this;</p>
<p></p>
<pre>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;
    &lt;sections&gt;

        /**
         * here we're telling the system we
         * we want to add a new config section
         * in the payment method area
         */
        &lt;payment&gt;
            &lt;groups&gt;
                &lt;modulename translate=&quot;label&quot; module=&quot;paygate&quot;&gt;

                    /**
                     * human readable module name
                     * which appears as the name of the
                     * payment method in the admin section
                     */
                    &lt;label&gt;My Payment Module&lt;/label&gt;

                    /**
                     * set where this method should appear
                     * in comparison to the other methods
                     * within the admin
                     */
                    &lt;sort_order&gt;670&lt;/sort_order&gt;
                    &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                    &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                    &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                    &lt;fields&gt;

                        /**
                         * you need this field if you want the user to
                         * be able to disable/enable this payment
                         * method. leave this out if you don't want
                         * this to be optional
                         */
                        &lt;active translate=&quot;label&quot;&gt;
                            &lt;label&gt;Enabled&lt;/label&gt;
                            &lt;frontend_type&gt;select&lt;/frontend_type&gt;

                            /**
                             * we want to use the standard Magento
                             * yes/no select options
                             */
                            &lt;source_model&gt;adminhtml/system_config_source_yesno&lt;/source_model&gt;
                            &lt;sort_order&gt;1&lt;/sort_order&gt;
                            &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                            &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                            &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                        &lt;/active&gt;

                        /**
                         * the below two fields are an example
                         * of fields you may need if integrating with
                         * a payment gateway's API. you will see how
                         * to retrieve these values in your code later
                         */
                        &lt;api_key translate=&quot;label&quot;&gt;
                            &lt;label&gt;API Key&lt;/label&gt;
                            &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                            &lt;sort_order&gt;2&lt;/sort_order&gt;
                            &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                            &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                            &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                        &lt;/api_key&gt;
                        &lt;api_secret translate=&quot;label&quot;&gt;
                            &lt;label&gt;API Secret&lt;/label&gt;
                            &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                            &lt;sort_order&gt;3&lt;/sort_order&gt;
                            &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                            &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                            &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                        &lt;/api_secret&gt;

                        /**
                         * having this field here allows the user
                         * to set whether we want payments to be
                         * authorised or authorised AND captured
                         * if you don't want the user to choose you
                         * can leave this field out
                         */
                        &lt;payment_action translate=&quot;label&quot;&gt;
                            &lt;label&gt;Payment Action&lt;/label&gt;
                            &lt;frontend_type&gt;select&lt;/frontend_type&gt;

                            /**
                             * we're using the source from the paygate
                             * module as it has the options we want. this
                             * is safe because the paygate module is a core
                             * Magento module and therefore will be there
                             * with any default install. if it makes you feel
                             * safer you can create your own field source model
                             * but that isn't covered in this tutorial
                             */
                            &lt;source_model&gt;paygate/authorizenet_source_paymentAction&lt;/source_model&gt;
                            &lt;sort_order&gt;4&lt;/sort_order&gt;
                            &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                            &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                            &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                        &lt;/payment_action&gt;

                        /**
                         * what do you want the status to be of
                         * new orders made using this payment
                         * method?
                         */
                        &lt;order_status translate=&quot;label&quot;&gt;
                            &lt;label&gt;New order status&lt;/label&gt;
                            &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                            &lt;source_model&gt;adminhtml/system_config_source_order_status_processing&lt;/source_model&gt;
                            &lt;sort_order&gt;5&lt;/sort_order&gt;
                            &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                            &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                            &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                        &lt;/order_status&gt;

                        /**
                         * this field lets the user choose the
                         * name of the payment method as it
                         * appears to the normal user on your site
                         */
                        &lt;title translate=&quot;label&quot;&gt;
                            &lt;label&gt;Title&lt;/label&gt;
                            &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                            &lt;sort_order&gt;6&lt;/sort_order&gt;
                            &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                            &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                            &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                        &lt;/title&gt;
                    &lt;/fields&gt;
                &lt;/modulename&gt;
            &lt;/groups&gt;
        &lt;/payment&gt;
    &lt;/sections&gt;
&lt;/config&gt;
</pre>
<p>
<strong>Default configuration values</strong></p>
<p>Before we go and test this, we should set some default values for the configuration fields we just created.</p>
<p>Open app/code/local/MyModules/ModuleName/etc/config.xml and add the following section;</p>
<pre>
&lt;config&gt;

    ...

    &lt;default&gt;
        &lt;payment&gt;
            &lt;modulename&gt;

                /**
                 * is this payment method enabled?
                 */
                &lt;active&gt;0&lt;/active&gt;

                /**
                 * this is where we tell the system what
                 * class to use to handle all of the payment
                 * logic. we call this class the payment
                 * adapter model class. you can change the
                 * paymentLogic bit to be what you want
                 * but it has to be lowerCamelCase and
                 * the class name will have to be changed later
                 * on as you will see
                 */
                &lt;model&gt;modulename/paymentLogic&lt;/model&gt;

                &lt;order_status&gt;pending&lt;/order_status&gt;
                &lt;title&gt;Credit Card (My Payment Method)&lt;/title&gt;

                &lt;api_key&gt;1234&lt;/api_key&gt;
                &lt;api_secret&gt;1234&lt;/api_secret&gt;

                /**
                 * this is the default set of allowed credit
                 * card types. leave this as it is for now
                 */
                &lt;cctypes&gt;AE,VI,MC,DI,SS&lt;/cctypes&gt;

                /**
                 * this should be authorize or authorize_capture
                 * you can probably guess that authorize just
                 * authorizes the payment but authorize_capture
                 * processes it as well
                 */
                &lt;payment_action&gt;authorize_capture&lt;/payment_action&gt;

                /**
                 * this field is used to say whether you only
                 * want this method to be used for certain
                 * countries but that is not covered by this
                 * tutorial
                 */
                &lt;allowspecific&gt;0&lt;/allowspecific&gt;
            &lt;/modulename&gt;
        &lt;/payment&gt;
    &lt;/default&gt;
&lt;/config&gt;
</pre>
<p>
Of course, if you have any of the fields in the above file configurable as set in system.xml, the user set value will be used.</p>
<p>
<strong>Test progress so far</strong></p>
<p>OK so now if you log into the Magento administration and go to System -&gt; Configuration -&gt; Payment methods you should see your new payment method somewhere in that list.</p>
<p>If you enable it it should then also be available if you checkout on your site as normal. Don&#8217;t complete any orders using it yet as there will be problems because we haven&#8217;t finished! We still need to create the most important part, the class which will handle all of the logic.</p>
<p>If you don&#8217;t see your payment method, please make sure you have completed the above steps correctly. Check for any simple mistakes and try clearing the Magento cache as well. The basic rule is; if it doesn&#8217;t appear in the payment method list in the administration section, there&#8217;s a problem with system.xml. If it doesn&#8217;t appear as a usable payment method when checking out, there could be a problem with config.xml.</p>
<p></p>
<h2><a name="4">4. Payment adapter model class</a></h2>
<p>Create the file PaymentLogic.php in app/code/local/MyModules/ModuleName/Model/. This is where we will put all of our payment gateway logic. First, the contents of the file;</p>
<pre>
&lt;?php
class CompanyName_NewModule_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
{
    /**
     * unique internal payment method identifier
     */
    protected $_code = 'newmodule';

    /**
     * this should probably be true if you're using this
     * method to take payments
     */
    protected $_isGateway               = true;

    /**
     * can this method authorise?
     */
    protected $_canAuthorize            = true;

    /**
     * can this method capture funds?
     */
    protected $_canCapture              = true;

    /**
     * can we capture only partial amounts?
     */
    protected $_canCapturePartial       = false;

    /**
     * can this method refund?
     */
    protected $_canRefund               = false;

    /**
     * can this method void transactions?
     */
    protected $_canVoid                 = true;

    /**
     * can admins use this payment method?
     */
    protected $_canUseInternal          = true;

    /**
     * show this method on the checkout page
     */
    protected $_canUseCheckout          = true;

    /**
     * available for multi shipping checkouts?
     */
    protected $_canUseForMultishipping  = true;

    /**
     * can this method save cc info for later use?
     */
    protected $_canSaveCc = false;

    /**
     * this method is called if we are just authorising
     * a transaction
     */
    public function authorize (Varien_Object $payment, $amount)
    {

    }

    /**
     * this method is called if we are authorising AND
     * capturing a transaction
     */
    public function capture (Varien_Object $payment, $amount)
    {

    }

    /**
     * called if refunding
     */
    public function refund (Varien_Object $payment, $amount)
    {

    }

    /**
     * called if voiding a payment
     */
    public function void (Varien_Object $payment)
    {

    }
}
?&gt;
</pre>
<p>If the payment_action option of &#8216;Authorise&#8217; has been selected, then only the authorize() method will be called and no payment can be taken automatically. If however the payment_action &#8216;Authorise and Capture&#8217; was selected, then only the capture() method will be called and that method should probably authorise the payment before capturing the funds. A bit confusing and not explained anywhere but that&#8217;s how it works!</p>
<p>The Varien_Object $payment object holds all data to do with the transaction and also the order.</p>
<p>So that&#8217;s it! That&#8217;s the method I used to add a custom payment gateway to Magento. Please note: I don&#8217;t work with Magento anymore so if you have a complicated question which requires looking into Magento code, I probably won&#8217;t be able to answer it &#8211; but ask anyway just in case!</p>
<br />Posted in Tutorials Tagged: gateway, magento, payment <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=136&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2009/11/11/magento-create-a-custom-payment-method/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery retrieving the data from an AJAX call into the global scope</title>
		<link>http://colourgray.wordpress.com/2009/07/27/jquery-retrieving-the-data-from-an-ajax-call-into-the-global-scope/</link>
		<comments>http://colourgray.wordpress.com/2009/07/27/jquery-retrieving-the-data-from-an-ajax-call-into-the-global-scope/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 09:06:16 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[scope]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=133</guid>
		<description><![CDATA[Another quick one. Reading around it seems to be an issue. You make an AJAX call within a function and you want the call to be synchronous so that you can use the data from the call in the function scope. AJAX calls are obviously asynchronous. jQuery has a &#8216;async: false&#8217; option in AJAX calls [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=133&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Another quick one. Reading around it seems to be an issue. You make an AJAX call within a function and you want the call to be synchronous so that you can use the data from the call in the function scope.</p>
<p>AJAX calls are obviously asynchronous. jQuery has a &#8216;async: false&#8217; option in AJAX calls but it is ignored by most (maybe all?) browsers. Using this method you can force a synchronous request and retrieve that data.</p>
<p><code>function myFunction()</code><br />
<code>{</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;var myVariable = $.ajax(</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;{</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url: 'someScript.php',</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;async: false</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;}).responseText;</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;alert(myVariable);</code><br />
<code>}</code></p>
<p>So .responseText retrieves the text value of the response from the AJAX call. And because we&#8217;re assigning to a variable we are forcing a synchronous request. You can now use that variable as you see fit.</p>
<p>This causes an issue when you are trying to retrieve a JSON object from an AJAX call into the function scope. The best way I&#8217;ve found so far is to retrieve the JSON as a string and use a jquery JSON plugin to convert it into an accessible object. Or you could just use the &#8216;eval&#8217; method.</p>
<p>Stephen.</p>
<br />Posted in Tutorials Tagged: ajax, javascript, jquery, json, scope <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=133&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2009/07/27/jquery-retrieving-the-data-from-an-ajax-call-into-the-global-scope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom SQL in symfony 1.2.3</title>
		<link>http://colourgray.wordpress.com/2009/06/29/custom-sql-in-symfony-1-2-3/</link>
		<comments>http://colourgray.wordpress.com/2009/06/29/custom-sql-in-symfony-1-2-3/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 09:59:24 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=128</guid>
		<description><![CDATA[Quick one. A small snippet for performing custom SQL queries using symfony 1.2.3. The method to do this has varied slightly with the different symfony releases. The method found on the symfony site almost has a good example, this is just adding a bit to it (looping); &#160;&#160;&#160;&#160;$conn = Propel::getConnection(); &#160;&#160;&#160;&#160;$query = 'SELECT * FROM [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=128&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Quick one. A small snippet for performing custom SQL queries using symfony 1.2.3. The method to do this has varied slightly with the different symfony releases. The method found on the symfony site almost has a good example, this is just adding a bit to it (looping);</p>
<p><code>&nbsp;&nbsp;&nbsp;&nbsp;$conn = Propel::getConnection();</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;$query = 'SELECT * FROM `my_table`;';</code><br />
<code></code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;$statement = $conn-&gt;prepare($query);</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;$statement-&gt;execute();</code><br />
<code></code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;while ($rowObj = $statement-&gt;fetch(PDO::FETCH_OBJ))</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;{</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo var_dump($rowObj);</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;}</code></p>
<p>Stephen.</p>
<br />Posted in Tutorials Tagged: custom, propel, sql, symfony <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=128&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2009/06/29/custom-sql-in-symfony-1-2-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery wildcard selectors &#8211; update</title>
		<link>http://colourgray.wordpress.com/2009/04/24/jquery-wildcard-selectors-update/</link>
		<comments>http://colourgray.wordpress.com/2009/04/24/jquery-wildcard-selectors-update/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 09:16:58 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[selector]]></category>
		<category><![CDATA[wildcard]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=123</guid>
		<description><![CDATA[Hello all, On my first post on this blog I posted a small snippet to use a small regex pattern in jQuery selectors. You can find the post here: http://colourgray.wordpress.com/2008/08/05/jquery-wildcard-selectors/ I was reading through some comments and posts on some incoming links and it seems it wasn&#8217;t working for anyone anymore. I just tested it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=123&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello all,</p>
<p>On my first post on this blog I posted a small snippet to use a small regex pattern in jQuery selectors.</p>
<p>You can find the post here: <a href="http://colourgray.wordpress.com/2008/08/05/jquery-wildcard-selectors/">http://colourgray.wordpress.com/2008/08/05/jquery-wildcard-selectors/</a></p>
<p>I was reading through some comments and posts on some incoming links and it seems it wasn&#8217;t working for anyone anymore. I just tested it myself and unfortunately it&#8217;s true (at least with with jQuery v1.3.1). However! All is not lost, there is another method which I&#8217;ve tested from one of the incoming links to that post which you can find here:</p>
<p><a href="http://ropox.net/archives/1081">http://ropox.net/archives/1081</a></p>
<p>Cheers ropox!</p>
<p>Stephen.</p>
<br />Posted in Tutorials Tagged: javascript, jquery, regex, selector, wildcard <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=123&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2009/04/24/jquery-wildcard-selectors-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>Symfony &#8220;Database &#8220;&#8221; does not exist.&#8221; error</title>
		<link>http://colourgray.wordpress.com/2009/03/02/symfony-database-does-not-exist-error/</link>
		<comments>http://colourgray.wordpress.com/2009/03/02/symfony-database-does-not-exist-error/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 11:20:34 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=119</guid>
		<description><![CDATA[Hello, It&#8217;s definitely been too long since I posted here! I will try and post more regularly over the coming months&#8230; Firstly, we came across this issue after writing a number of plugins for a symfony project. Each of these plugins had their own schema.yml files and therefore we didn&#8217;t need our own custom schema.yml [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=119&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>It&#8217;s definitely been too long since I posted here! I will try and post more regularly over the coming months&#8230;</p>
<p>Firstly, we came across this issue after writing a number of plugins for a symfony project. Each of these plugins had their own schema.yml files and therefore we didn&#8217;t need our own custom schema.yml file at that time.</p>
<p>Because of this, our config/schema.yml file looked like this:</p>
<p><code>&nbsp;&nbsp;&nbsp;&nbsp;propel:</code></p>
<p>Pretty, right? When we ran symfony propel:build-sql (after the other usual build tasks) we got the error:</p>
<p><code>&nbsp;&nbsp;&nbsp;&nbsp;Database "" does not exist.</code></p>
<p>In symfony&#8217;s glorious vibrant red error container. It seems when your schema file looks like ours did above, symfony generates the sqldb.map file for that file without a database name, our data/sql/sqldb.map file looked similar to this:</p>
<p><code><br />
&nbsp;&nbsp;&nbsp;&nbsp;# Sqlfile -&gt; Database map<br />
&nbsp;&nbsp;&nbsp;&nbsp;...<br />
&nbsp;&nbsp;&nbsp;&nbsp;lib.model.schema.sql=propel<br />
&nbsp;&nbsp;&nbsp;&nbsp;plugins.pluginName.lib.model.schema.sql=propel<br />
&nbsp;&nbsp;&nbsp;&nbsp;plugins.pluginName2.lib.model.schema.sql=propel<br />
&nbsp;&nbsp;&nbsp;&nbsp;generated-schema.sql=propel<br />
&nbsp;&nbsp;&nbsp;&nbsp;generated-pluginName-schema.sql=propel<br />
&nbsp;&nbsp;&nbsp;&nbsp;generated-pluginName2-schema.sql=propel<br />
&nbsp;&nbsp;&nbsp;&nbsp;...<br />
</code></p>
<p>The quick fix, especially if you don&#8217;t want to have to add a custom table in your schema just to get round this, is to simple add &#8216;propel&#8217; onto the end of the line that is missing it.</p>
<p>Hopefully there&#8217;s a proper fix that I so far haven&#8217;t been bothered to find&#8230;</p>
<br />Posted in Tutorials Tagged: error, propel, schema, symfony <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=119&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2009/03/02/symfony-database-does-not-exist-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>symfony Unable to parse default value as date/time value: &#8217;0000-00-00 00:00:00&#8242;</title>
		<link>http://colourgray.wordpress.com/2008/09/26/symfony-unable-to-parse-default-value-as-datetime-value-0000-00-00-000000/</link>
		<comments>http://colourgray.wordpress.com/2008/09/26/symfony-unable-to-parse-default-value-as-datetime-value-0000-00-00-000000/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 13:53:19 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=114</guid>
		<description><![CDATA[I&#8217;ve just made a change to a symfony project&#8217;s schema.yml file and tried to rebuild the model and came across this error message: Unable to parse default value as date/time value: &#8217;0000-00-00 00:00:00&#8242; Which was stopping the build. After looking at various places, it seems this is a problem with Creole, (propel&#8217;s DBAL). Before PHP [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=114&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just made a change to a symfony project&#8217;s schema.yml file and tried to rebuild the model and came across this error message:</p>
<p>Unable to parse default value as date/time value: &#8217;0000-00-00 00:00:00&#8242;</p>
<p>Which was stopping the build. After looking at various places, it seems this is a problem with Creole, (propel&#8217;s DBAL).</p>
<p>Before PHP v5.2.4, you could do a strtotime on a value of 000-00-00 00:00:00 and you would get a weird date, something in 1999. Not sure why :S Since the 5.2.4 update however this bug has been fixed and you will now get boolean false returned.</p>
<p>The symfony plugin sfGuard, which is widely used, uses 0000-00-00 00:00:00 as a default value in it&#8217;s schema for some fields and this will now cause problems. To fix this, edit sfGuard&#8217;s schema and change those default values to something like 1970-01-01 and that should do the trick.</p>
<p>Unfortunately Creole isn&#8217;t actively maintained anymore so it&#8217;s not likely to be updated soon to fix this.</p>
<br />Posted in Tutorials Tagged: date, error, propel, symfony, time <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=114&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2008/09/26/symfony-unable-to-parse-default-value-as-datetime-value-0000-00-00-000000/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery loading remote/external javascript files using getScript()</title>
		<link>http://colourgray.wordpress.com/2008/09/22/jquery-loading-external-javascript-files-using-getscript/</link>
		<comments>http://colourgray.wordpress.com/2008/09/22/jquery-loading-external-javascript-files-using-getscript/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 08:57:22 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[external]]></category>
		<category><![CDATA[getScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[remote]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=109</guid>
		<description><![CDATA[I&#8217;ve been working over the weekend on a site and I got to the part of writing the client side MVC using jQuery (because I love the idea now!). I found out that jQuery has a nice little method for loading external scripts into the page at run time called getScript(). It basically gets the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=109&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working over the weekend on a site and I got to the part of writing the client side MVC using jQuery (because I love the idea now!).</p>
<p>I found out that jQuery has a nice little method for loading external scripts into the page at run time called getScript(). It basically gets the contents of the external file using an AJAX request and then eval()s the code at runtime, which seems like a perfect way of doing it. I reckon it&#8217;s much better than appending new &lt;script&gt; tags to the &lt;head&gt; tag as well.</p>
<p>The only issue is that it can take some time to load an external file so you can&#8217;t always run functions from within that file straight away. Thankfully there is a workaround for this using another jQuery method. You basically set all AJAX request to be synchronous before you run getScript() and then set AJAX requests to be asynchronous again after the script is loaded. If you end up loading like 20 files at the beginning of a page load this could take a while but hopefully you won&#8217;t be doing that <img src='http://s1.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><code>$.ajaxSetup({async: false});</code><br />
<code>$.getScript(MVCRoot+fileName+'.js');</code><br />
<code>$.ajaxSetup({async: true});</code></p>
<p><a href="http://docs.jquery.com/Ajax/jQuery.getScript">And here&#8217;s some more info on this lovely little function <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </a></p>
<br />Posted in Tutorials Tagged: external, getScript, jquery, remote <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=109&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2008/09/22/jquery-loading-external-javascript-files-using-getscript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>SproutCore: a proper javascript framework</title>
		<link>http://colourgray.wordpress.com/2008/09/17/sproutcore-a-proper-javascript-framework/</link>
		<comments>http://colourgray.wordpress.com/2008/09/17/sproutcore-a-proper-javascript-framework/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 17:03:49 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Dev thoughts]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[sproutcore]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=107</guid>
		<description><![CDATA[I wrote a while ago about creating a client side MVC system in javascript. Yesterday at one of the talks SproutCore was mentioned. I had a look today and it looks very promising. It&#8217;s a full framework designed to create full &#8216;thick client&#8217; javascript applications. The core of it was written in Ruby and I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=107&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wrote a while ago about<a href="http://colourgray.wordpress.com/2008/08/28/jquery-create-a-client-side-mvc/"> creating a client side MVC system</a> in javascript.</p>
<p>Yesterday at one of the talks <a href="http://www.sproutcore.com/">SproutCore</a> was mentioned. I had a look today and it looks very promising. It&#8217;s a full framework designed to create full &#8216;thick client&#8217; javascript applications. The core of it was written in Ruby and I haven&#8217;t looked into whether you have to know much Ruby to develop in it or not. It reminds me of <a href="http://www.symfony-project.org">symfony</a> because you are given a number of build tools to use on the command line for creating controllers, new projects, models etc etc.</p>
<p>I think I&#8217;m falling in love with the general idea and it&#8217;s great to see someone has actually implemented it quite well (from the looks of it). I haven&#8217;t had the chance to try it out yet but I&#8217;m thinking of using it on a number of personal projects so we&#8217;ll see how it goes!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/colourgray.wordpress.com/107/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/colourgray.wordpress.com/107/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=107&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2008/09/17/sproutcore-a-proper-javascript-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Developer Day 2008</title>
		<link>http://colourgray.wordpress.com/2008/09/17/google-developer-day-2008/</link>
		<comments>http://colourgray.wordpress.com/2008/09/17/google-developer-day-2008/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 16:54:49 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Dev thoughts]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=101</guid>
		<description><![CDATA[I had the fortune yesterday to attend the Google Developer Day 2008 in Wembley Stadium with a colleague from work. We were told there were around 800 people there but with everyone sat down at the morning keynote meeting it didn&#8217;t seem like so many. Also, pretty much everyone there had an iPhone! Everywhere you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=101&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had the fortune yesterday to attend the Google Developer Day 2008 in Wembley Stadium with a colleague from work.</p>
<p>We were told there were around 800 people there but with everyone sat down at the morning keynote meeting it didn&#8217;t seem like so many. Also, pretty much everyone there had an iPhone! Everywhere you looked someone had an iPhone out. I guess it&#8217;s not surprising with so many geeks in one room <img src='http://s1.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>The whole experience was good, the talks were in depth and on the most part interesting (we went to the wrong room at one point due to a late room switch and I couldn&#8217;t help but get a bit sleepy &#8211; the room was hot!).</p>
<p>There was an interesting talk by Dion Almaer on AJAX, Dion is the co-owner of <a href="http://www.ajaxian.com" target="_blank">Ajaxian</a>. The session was called &#8216;The State of AJAX&#8217; and he talked about how AJAX has come along in recent times and about the current popular javascript frameworks and libraries. He made a good summary of the current status of these frameworks and talked about how with each framework&#8217;s most recent user interface plug ins they are all very similar in functionality.</p>
<p>So which framework is best to use is now down to personal preference, where as before it was down to which framework was best for what you wanted to do. It certainly made me think about how JavaScript has become a mainstream language and it&#8217;s made me think about concentrating on JavaScript as my primary language. It&#8217;s strange, as up until recently a lot of people only saw JavaScript as an &#8216;add-on&#8217; language, if that&#8217;s the right way to describe it. But now with the way the web is going, with rich user interfaces and applications, JavaScript is definitely the way forward.</p>
<p>There were also talks on the Google App Engine and Google Web Toolkit. Both of these are very interesting offerings but I&#8217;m not sure whether I personally, or the company I work for will have use for either of them. At least for the near future.</p>
<p>The Google App Engine is &#8211; in it&#8217;s most basic form &#8211; another cloud service. Much like Amazon&#8217;s EC2 service. Google are now offering the ability to host your web site or application on their existing infrastructure/system architecture. There are the same obvious advantages to using this system as there are with Amazon; large scalability, strong infrastructure, fast up link speeds etc etc. You initially get 500mb of free space, 2GB of bandwidth per day and up to 5 million page views per month for free. After which you need to start forking out the cash. From what I gathered after using your free allowances, the service won&#8217;t be charged on a pay as you go service as with Amazon, but you will have to buy &#8216;blocks&#8217; of extra dish space, bandwidth etc etc. Personally I think I prefer the pay as you go method, but I haven&#8217;t done any calculations to see which would be cheaper so I could easily be wrong.</p>
<p>Unfortunately, the only language currently supported on the Google App Engine is Python. They mentioned yesterday that they are committed to adding more language runtimes to the system, but seeing as Python is one of Google&#8217;s 3 main languages, it was their obvious first choice. Sites and apps can only be pure Python as well, so no using plug ins/extensions which depend on C++ etc.</p>
<p>Google App engine is obviously still very mature so it wouldn&#8217;t be fair to compare it to the other cloud services currently on offer but so far, I think Amazon&#8217;s EC2 service is still on top. I won&#8217;t go into why here <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I was very impressed by the Google Web Toolkit (GWT). The general idea is that you write your Java application in your normal IDE, run the GWT compiler against your Java code and it compiles your normal Java code into JavaScript and HTML files that can be run in any browser. Obviously this is pretty powerful. The example that we got shown was a full GUI application written in Java for viewing or creating complex diagrams. It seemed to run perfectly in the browser, looking just like it would on the desktop. All current popular browsers are automatically supported and the compiler also optimises and obfuscates the generated JavaScript and HTML code. What more could you ask for? The only problem is I don&#8217;t currently know Java and I don&#8217;t believe my company has any intentions of using Java for anything soon <img src='http://s1.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  But an impressive product none the less.</p>
<p>Throughout the day there were free refreshments and snacks and we were provided with a free (mostly) healthy lunch. At the end of the day they showed a video summarising the day&#8217;s events and then there were drinks and food after which I wasn&#8217;t able to stay for <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  My colleague stayed on for a while and told me they had a Wii being played on the huge presentation screens with Guitar Hero, among other things such as retro Atari arcade consoles. It&#8217;s a shame I didn&#8217;t stay, I&#8217;d have been able to say I beat some Google guys at Guitar Hero! Woop <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The day was a good experience and I&#8217;d go again, although some sessions did seem quite long and the seats weren&#8217;t exactly comfortable, but a small price to pay for an event like this <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Oh yeah, I didn&#8217;t take any photos except for a few of the Wembley pitch (by going through a door I don&#8217;t think we were allowed to go through) because I was told I wasn&#8217;t allowed. Then we saw lots of other people taking pictures :S Ah well&#8230;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/colourgray.wordpress.com/101/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/colourgray.wordpress.com/101/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=101&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2008/09/17/google-developer-day-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
		<item>
		<title>Flex save changes from an AdvancedDataGrid using itemEditEnd</title>
		<link>http://colourgray.wordpress.com/2008/09/15/flex-save-changes-from-an-advanceddatagrid-using-itemeditend/</link>
		<comments>http://colourgray.wordpress.com/2008/09/15/flex-save-changes-from-an-advanceddatagrid-using-itemeditend/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 10:38:22 +0000</pubDate>
		<dc:creator>Stephen Gray</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[advanceddatagrid]]></category>
		<category><![CDATA[datagrid]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[itemEditEnd]]></category>
		<category><![CDATA[save]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=96</guid>
		<description><![CDATA[I just remembered that I had trouble finding out what I could access with this event handler function. Sure it was easy to find out when the event is dispatched, but how can I access the new field value edited by the user? How do I access the previous value? So this is just a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=96&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just remembered that I had trouble finding out what I could access with this event handler function. Sure it was easy to find out when the event is dispatched, but how can I access the new field value edited by the user? How do I access the previous value?</p>
<p>So this is just a simple example showing you that. This also applies to the normal DataGrid and standard list controls.</p>
<p>The itemEditEnd event is dispatched (it&#8217;s in the name) when a user finishes editing a cell so this is pretty much the best time to save the user&#8217;s changes to that field/row.</p>
<p>Here&#8217;s our function:</p>
<p><code>protected function saveChange(event:AdvancedDataGridEvent):void</code><br />
<code>{</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;/**</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* use event.dataField to get the edited field name</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;var field:String = event.dataField;</code><br />
<code></code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;/**</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* i'm using the following line to get the 'id' of the row being edited</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* because i passed an 'id' field through from my dataProvider.</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;var selectedID:String = event.currentTarget.selectedItem.id.toString();</code><br />
<code></code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;/**</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* use the itemEditorInstance to get the newly edited value but retrieve</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* the previous value from the existing grid data. i'm using the default</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* textinput itemRenderer so I can retrieve the new value using the </code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* itemEditInstance's 'text' property.</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;var newValue:String = event.currentTarget.itemEditorInstance.text;</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;var prevValue:String = ProductPersonalisationList.selectedItem[event.dataField];</code></p>
<p><code>&nbsp;&nbsp;&nbsp;&nbsp;// run a http service call or something to save the change or validate the data</code><br />
<code>}</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/colourgray.wordpress.com/96/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/colourgray.wordpress.com/96/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/colourgray.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/colourgray.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/colourgray.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/colourgray.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/colourgray.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/colourgray.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/colourgray.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/colourgray.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/colourgray.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/colourgray.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/colourgray.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/colourgray.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/colourgray.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/colourgray.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=colourgray.wordpress.com&amp;blog=4318111&amp;post=96&amp;subd=colourgray&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://colourgray.wordpress.com/2008/09/15/flex-save-changes-from-an-advanceddatagrid-using-itemeditend/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/717393f091b7d194303f60afa59f2f39?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Gray</media:title>
		</media:content>
	</item>
	</channel>
</rss>
