<?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>Matt Stine&#039;s Blog &#187; ajax</title>
	<atom:link href="http://mattstine.com/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattstine.com</link>
	<description>Thoughts on Java, Groovy, Grails, Agile Development, etc. etc. etc.</description>
	<lastBuildDate>Tue, 17 May 2011 17:02:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mattstine.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Matt Stine&#039;s Blog &#187; ajax</title>
		<link>http://mattstine.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mattstine.com/osd.xml" title="Matt Stine&#039;s Blog" />
	<atom:link rel='hub' href='http://mattstine.com/?pushpress=hub'/>
		<item>
		<title>Grails, Prototype, Script.aculo.us &#8211; Persistent Grid Sorting Goodness</title>
		<link>http://mattstine.com/2009/04/25/grails-prototype-scriptaculous-persistent-grid-sorting-goodness/</link>
		<comments>http://mattstine.com/2009/04/25/grails-prototype-scriptaculous-persistent-grid-sorting-goodness/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 05:14:40 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[scriptaculous]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/?p=139</guid>
		<description><![CDATA[Ever wanted to do drag-n-drop sorting of a grid of images on a page and persist it? Here&#8217;s my solution using Grails, Prototype, and Script.aculo.us. Basically what prompted this was the need for my wife to be able to sort the various product images that she had on a screen at any given time in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=139&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to do drag-n-drop sorting of a grid of images on a page and persist it? Here&#8217;s my solution using Grails, Prototype, and Script.aculo.us.</p>
<p>Basically what prompted this was the need for my wife to be able to sort the various product images that she had on a screen at any given time in any way that she pleased, and it had to be easy to work with. What follows is by no means a complete solution to this problem, but it represents where I am in the development process and may be useful to you, my hapless reader.</p>
<p>Here&#8217;s some GSP code which basically lays out a grid of product images, 3 wide by <em>n</em> deep:</p>
<pre class="brush: xml">
&lt;div id="productThumbContainer"&gt;
  &lt;g:set var="rowIndex" value="${0}"/&gt;
&lt;g:each in="${products}" var="product" status="index"&gt;
  &lt;g:if test="${index % 3 == 0}"&gt;
    &lt;div id="productRow${rowIndex}" class="span-20 last product-row"&gt;
  &lt;/g:if&gt;
  &lt;div id="product_${product.id}" class="span-6 product &lt;g:if test="${(index % 3 == 2) || ((products.size() - index) == 1)}"&gt;last&lt;/g:if&gt;&lt;g:else&gt;append-1&lt;/g:else&gt;"&gt;
    &lt;img src="${resource(dir: grailsApplication.config.store.productImages.webPath, file: product?.thumbnailImage?.name)}" width="230" class="productImage"&gt;
    &lt;h3&gt;&lt;g:link controller="product" action="show" id="${product.id}"&gt;${product.name}&lt;/g:link&gt;&lt;/h3&gt;
  &lt;/div&gt;
  &lt;g:if test="${(index % 3 == 2) || ((products.size() - index) == 1)}"&gt;
    &lt;/div&gt;
    &lt;g:set var="rowIndex" value="${rowIndex + 1}"/&gt;
  &lt;/g:if&gt;
&lt;/g:each&gt;
&lt;/div&gt;
</pre>
<p>Now here&#8217;s where the magic happens:</p>
<pre class="brush: js">
document.observe('dom:loaded', function() {
      var productRows = $$('.product-row');

      var options = {
        constraint: false,
        overlap: 'horizontal',
        containment: productRows,
        dropOnEmpty: true,
        tag: 'div',
        onUpdate: updateRows
      };

      productRows.each(function(item) {
        Sortable.create(item, options);
      });

      $('persistOrderingButton').observe('click', function(event) {
          var sortString = '';
          productRows.each(function(row) {
              sortString += '&amp;';
              sortString += Sortable.serialize(row);
          });
          &lt;g:remoteFunction action="sortProducts" params="sortString" update="ajaxMessage" onSuccess="\$('ajaxMessage').show()"/&gt;
      });
});
</pre>
<p>What we&#8217;ve got here is, failure to communicate&#8230;oops, wrong synapse there&#8230;what we&#8217;ve got here is a Prototype selector that grabs everything with the class &#8220;.product-row.&#8221; It then takes these and creates a Scriptaculous Sortable for each of them, providing the object-literal &#8220;options.&#8221; Notice the &#8220;containment&#8221; option which allows you to drag products back and forth between the various rows.</p>
<p>Delving deeper into the magic is the callback function &#8220;updateRows.&#8221; This guy is my favorite Javascript creation in quite some time:</p>
<pre class="brush: js">
function updateRows(list) {
      var children = list.childElements();

      if (children.size() &lt; 3) {

        //If I&#039;m the last row, who cares!
        if (list.next() != null) {
          var prevRow = list.previous();

          if (prevRow != null) {
            var lastChild = prevRow.childElements()[prevRow.childElements().size() - 1].remove();
            list.insert({top:lastChild});
            updateRows(prevRow);
          } else {
            var lastRow = list.up().childElements()[list.up().childElements().size() - 1];
            var lastChild = lastRow.childElements()[lastRow.childElements().size() - 1].remove();
            list.insert({top:lastChild});
            updateRows(lastRow);
          }
        }
      } else if (children.size() == 3) {
        //Do nothing...gets me out of the recursion I hope!
      } else {
        var nextRow = list.next();
        var lastChild = children[children.size() - 1].remove();

        if (nextRow != null) {
          nextRow.insert({top:lastChild});
          updateRows(nextRow);
        } else {
          var topRow = list.up().childElements()[0];
          topRow.insert({top:lastChild});
          updateRows(topRow);
        }
      }

      var i = 0;
      Sortable.sequence(list).each(function(item) {
        var productId = &#039;product_&#039; + item;
        if (i &lt; 2) {
          $(productId).removeClassName(&#039;last&#039;);
          $(productId).removeClassName(&#039;append-1&#039;);
          $(productId).addClassName(&#039;append-1&#039;);
        } else {
          $(productId).removeClassName(&#039;last&#039;);
          $(productId).removeClassName(&#039;append-1&#039;);
          $(productId).addClassName(&#039;last&#039;);
        }
        i++;
      });
}
</pre>
<p>This function is organized around the fact that the only valid state for a grid of n-rows will be n-1 rows of 3 products, followed by one row of 1 &lt;= numProducts &lt;= 3. In most cases, if you drag a product from one row to another, you are violating that rule by creating a row with 2 products and a row with 4 products. This function solves the problem by recursively shifting the products down until reaching a stable state again.</p>
<p>There&#039;s a bit of noise there at the bottom of the function. I&#039;m using Blueprint CSS to do the layout for this application and I need to shift the various Blueprint classes around once everything is settled.</p>
<p>Finally, here&#039;s the persistence of the data when we click save:</p>
<pre class="brush: groovy">
def sortProducts = {
    TreeMap rowMap = new TreeMap()

    params.each {key, value -&gt;
      def matcher = key =~ /productRow(.*)\[\]/
      if (matcher.matches()) {
        def rowId = matcher[0][1]
        rowMap[rowId] = value
      }
    }

    def productIds = []
    rowMap.values().each { row -&gt;
      row.each {
        productIds &lt;&lt; it.toLong()
      }
    }

    shoppingService.saveSortOrder(productIds)

    render(&quot;Product sort order saved!&quot;)
}
</pre>
<p>and the logic from shoppingService.saveSortOrder():</p>
<pre class="brush: groovy">
def saveSortOrder(def productIds) {
    def productsToSort = Product.findAllByIdInList(productIds)

    def productMap = [:]
    def sortIndexList = []

    productsToSort.each {
      productMap[it.id] = it
      sortIndexList &lt;&lt; it.sortIndex
    }

    sortIndexList.sort()
    sortIndexList = sortIndexList.reverse()

    productIds.each {
      productMap[it].sortIndex = sortIndexList.pop()
    }

    productsToSort.each {
      it.save()
    }
}
</pre>
<p>You might wonder why this is so complex. What I haven&#8217;t fully described is the way products are organized into a hierarchy of various categories. When you&#8217;re sorting a screen, you&#8217;re only sorting a subset of the products that are in that particular category. However, the sort order is maintained across the entire product set in the database. So, this logic basically just shifts around the existing sort indicies, placing them in their new relative order.</p>
<p>Anyway, I don&#8217;t know how generally applicable this code is, but I had fun writing it and I hope you can get some use out of it. Cheers!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=139&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2009/04/25/grails-prototype-scriptaculous-persistent-grid-sorting-goodness/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>
	</item>
		<item>
		<title>Ajax Integration Guide for 2008: Jeremy Grelle</title>
		<link>http://mattstine.com/2007/12/14/ajax-integration-guide-for-2008-jeremy-grelle/</link>
		<comments>http://mattstine.com/2007/12/14/ajax-integration-guide-for-2008-jeremy-grelle/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 20:40:00 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[thespringexperience2007]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/?p=51</guid>
		<description><![CDATA[This talk looked really exciting going in. Jeremy is a member of the Spring Web Products team and the lead of Spring Faces, as well as a member of the JSF 2.0 Expert Group. He describes himself as the resident Ajax freak at SpringSource. Jeremy began by discussing the current Ajax landscape, highlighting what he [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=51&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This talk looked really exciting going in. Jeremy is a member of the Spring Web Products team and the lead of Spring Faces, as well as a member of the <span class="blsp-spelling-error" id="SPELLING_ERROR_0">JSF</span> 2.0 Expert Group. He describes himself as the resident Ajax freak at <span class="blsp-spelling-error" id="SPELLING_ERROR_1">SpringSource</span>. Jeremy began by discussing the current Ajax landscape, highlighting what he believes are the important features a successful framework must deliver, and then identifying the frameworks he considers to be the cream of the crop. No surprises here on the list: Prototype/<span class="blsp-spelling-error" id="SPELLING_ERROR_2">Scriptaculous</span>, <span class="blsp-spelling-error" id="SPELLING_ERROR_3">jQuery</span>, <span class="blsp-spelling-error" id="SPELLING_ERROR_4">YUI</span>, Ext, and <span class="blsp-spelling-error" id="SPELLING_ERROR_5">Dojo</span>. He then gave a brief high-level overview of each framework &#8211; I really didn&#8217;t learn anything new here, as I&#8217;ve been following these frameworks for quite awhile. He mentioned the commonality that all of these frameworks are about more than asynchronous client-server communication &#8211; they&#8217;re about improving your client-side code and user experience. See Dion&#8217;s May 2007 comment that Ajax &#8220;was never about the acronym &#8211; it&#8217;s about building killer websites.&#8221; What is good about all of these frameworks is that you can use all of them in an unobtrusive manner and progressively enhance your <span class="blsp-spelling-error" id="SPELLING_ERROR_6">UI</span>. This gives you the ability to only <span class="blsp-spelling-error" id="SPELLING_ERROR_7">Ajaxify</span> what you need and also get graceful degradation.</p>
<p>In the second portion of his talk, Jeremy talked about connecting to Spring. I was really hoping that the &#8220;goods&#8221; would be delivered here. He started by mentioning <span class="blsp-spelling-error" id="SPELLING_ERROR_8">DWR</span>, which I think is a really nice framework. It merited 2 slides and no demo (even though there was a slide mentioning a demo). I don&#8217;t think Jeremy really cares for it or <span class="blsp-spelling-error" id="SPELLING_ERROR_9">GWT</span>, as he sort of lumped them together and didn&#8217;t mention them again. I do appreciate his point that neither really allows you to harvest any existing controlling infrastructure that we may have built using Spring <span class="blsp-spelling-error" id="SPELLING_ERROR_10">MVC</span> or another framework.</p>
<p>Jeremy then moved into what he considers the better way to do it, which is the progressive enhancement I mentioned above. He took the existing Spring Booking <span class="blsp-spelling-error" id="SPELLING_ERROR_11">MVC</span> + Web Flow example application and <span class="blsp-spelling-error" id="SPELLING_ERROR_12">ajaxified</span> portions of it. He did this using an interesting combination of Apache Tiles, some Javascript &#8220;pseudo-<span class="blsp-spelling-error" id="SPELLING_ERROR_13">AOP</span>&#8221; he lifted from the <span class="blsp-spelling-error" id="SPELLING_ERROR_14">SpringFaces</span> project, and a bit of <span class="blsp-spelling-error" id="SPELLING_ERROR_15">Dojo</span>. It seemed to work really well, but it wasn&#8217;t immediately clear how this type of technology was going to be made available to us as developers. He said something along the lines of &#8220;you don&#8217;t have to be using <span class="blsp-spelling-error" id="SPELLING_ERROR_16">JSF</span> to use this Javascript, so we probably need to change the name to something else.&#8221; I hope they figure out soon so I can get my hands on it. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>He closed by briefly discussing <span class="blsp-spelling-error" id="SPELLING_ERROR_17">REST&#8217;s</span> place in the future of Spring Web. The ideal scenario, according to Jeremy, is that we will be able to request different representations of the same resource. For example, we could request HTML for full page display or partial DOM updates, and <span class="blsp-spelling-error" id="SPELLING_ERROR_18">JSON</span> for intelligent widgets like the <span class="blsp-spelling-error" id="SPELLING_ERROR_19">Dojo</span> table.</p>
<p>It looks like a lot of exciting things will happen in 2008. I hope I don&#8217;t have to wait too long.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mattstine.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mattstine.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=51&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2007/12/14/ajax-integration-guide-for-2008-jeremy-grelle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>
	</item>
		<item>
		<title>Thursday was slow&#8230;</title>
		<link>http://mattstine.com/2007/05/11/thursday-was-slow/</link>
		<comments>http://mattstine.com/2007/05/11/thursday-was-slow/#comments</comments>
		<pubDate>Sat, 12 May 2007 03:17:00 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[restaurants]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/?p=32</guid>
		<description><![CDATA[for me, not for JavaOne. Of course I was a good little programmer and used the schedule builder to sign up for all of my sessions. I edited them a bit after the first two keynotes. Even then, I had one lone session scheduled for Thursday morning (that wasn&#8217;t really directly applicable to my work, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=32&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>for me, not for JavaOne. Of course I was a good little programmer and used the schedule builder to sign up for all of my sessions. I edited them a bit after the first two keynotes. Even then, I had one lone session scheduled for Thursday morning (that wasn&#8217;t really directly applicable to my work, it just looked interesting), and then two sessions in the afternoon, the first starting at 4:10. I decided to skip out on the morning session and do a little shopping at Pier 39. The highlight was a &#8220;Bucket of Boat Trash&#8221; and clam chowder at the Bubba Gump Shrimp Company. And yes, we Ole Miss Rebels are represented as far out as the end of Pier 39:</p>
<p><a href="http://picasaweb.google.com/matt.stine/SanFranciscoJavaOne2007/photo#5063511710562298018"><img src="http://lh4.google.com/image/matt.stine/RkU1ErgYqKI/AAAAAAAAAMA/6BJ0mkhqgn8/s288/DSCN1117.JPG" /></a></p>
<p>The two sessions that I attended were:</p>
<p>- RubyTooling: State of the Art<br />- Using Ajax with POJC (Plain Old JavaServer Faces Components)</p>
<p>I attended the first session simply to get a little more detail on all of the hype surrounding Ruby tooling support in NetBeans 6. What I got was even more than I bargained for. The project leaders actually walked us through not only the features that were available, but how they were implemented. I had never really thought about the problems with providing code completion and refactoring with a dynamically-typed language. It was really cool to see the thought process that went into their solutions. I&#8217;d love to hear a similar discussion from the JetBrains guys, as the Ruby support in IntelliJ IDEA is quite good as well.</p>
<p>For me the second session was the best of the conference for me up until that point, and arguably it still is after attending Friday&#8217;s sessions. Craig McClanahan, of Struts fame, was the main speaker and was joined by his colleagues Matthew Bohm and Jayashri Visvanathan. What made this session so good for me was that they presented a problem &#8211; &#8220;How can I add Ajax behaviors to my JavaServer™ Faces technology based application, without throwing away my investment in existing component libraries?&#8221; &#8211; and then provided three different solutions to that problem &#8211; low, medium, and high level.</p>
<p>The low level consisted of simply using the HTML event pass-through attributes that are implemented by most standard JSF components (onClick, onBlur, etc.). One could use an existing JavaScript framework such as Dojo to send an XMLHttpRequest and then map that request to a Servlet or JSF handler using a technology such as Shale Remoting. The response could be sent back as JSON data which could then be transformed into the desired UI update.</p>
<p>The medium level consisted of actually extending existing JSF components and adding the desired Ajax behavior. Due to time constraints they didn&#8217;t cover this solution in detail, but they did provide a link to a detailed discussion in the Java BluePrints catalog: https://blueprints.dev.java.net/bpcatalog/ee5/ajax/extendingRenderFunctionality.html</p>
<p>The high level solutions addressed the following needs (copied directly from the slides):</p>
<p>● Partial page submit—gather up a particular set of<br />input element values, and send them to a bit of server<br />side business logic<br />● Partial page refresh—the business logic needs to<br />refresh the content of one or more subtrees of the<br />client side DOM<br />● Synchronization—the benefits of synchronizing the<br />server side state<br />● Don’t repeat yourself (DRY)—reuse existing<br />components and renderers for partial page updates</p>
<p>To address these issues, the speakers highlighted two add-on frameworks:</p>
<p>● Ajax4JSF (http://labs.jboss.com/portal/jbossajax4jsf)<br />● Dynamic Faces (https://jsf-extensions.dev.java.net/)</p>
<p>I was quite impressed with both of these frameworks. One of my colleagues is currently implementing Ajax behavior in a Facelets-based application using Ajax4JSF and he is quite happy with it. Dynamic Faces looked really awesome, especially its tooling support in NetBeans (actually I&#8217;m quite impressed with the overall JSF support in NetBeans &#8211; I&#8217;ll definitely be adding it to my tool belt). The highlight of the presentation was Matt&#8217;s video of him building an entire currency trading application in 28 minutes &#8211; except it was &#8220;fast-played&#8221; to finish in 3 1/2 minutes and set to techno music. Matt wowed us with his dancing abilities while we watched true RAD. The crowd went wild!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mattstine.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mattstine.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=32&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2007/05/11/thursday-was-slow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>

		<media:content url="http://lh4.google.com/image/matt.stine/RkU1ErgYqKI/AAAAAAAAAMA/6BJ0mkhqgn8/s288/DSCN1117.JPG" medium="image" />
	</item>
		<item>
		<title>Wednesday was AJAX Day</title>
		<link>http://mattstine.com/2007/05/10/wednesday-was-ajax-day/</link>
		<comments>http://mattstine.com/2007/05/10/wednesday-was-ajax-day/#comments</comments>
		<pubDate>Thu, 10 May 2007 23:49:00 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[jMaki]]></category>
		<category><![CDATA[jsf]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/?p=31</guid>
		<description><![CDATA[Not officially, but nearly every session I attended had something to do with AJAX: - Creating Amazing Web Interfaces with Ajax- jMaki: Web 2.0 App Building Made Easy- Fast, Beautiful, Easy: Pick Three &#8211; Building Web User Interfaces in the Java Programming Language with Google Web Toolkit- Killer JavaScript Technology Frameworks for Java Platform Developers: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=31&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Not officially, but nearly every session I attended had something to do with AJAX:</p>
<p>- Creating Amazing Web Interfaces with Ajax<br />- jMaki: Web 2.0 App Building Made Easy<br />- Fast, Beautiful, Easy: Pick Three &#8211; Building Web User Interfaces in the Java Programming Language with Google Web Toolkit<br />- Killer JavaScript Technology Frameworks for Java Platform Developers: An Exploration of Prototype, Script.aculo.us, and Rico</p>
<p>I have to say that I was rather impressed by what I saw.</p>
<p>The first talk was by Ben and Dion, the Ajaxian guys. It was an appropriate way to start, as they gave a quick history overview of Ajax. One nice point they made was that Ajax really isn&#8217;t about the acronym &#8211; it never was &#8211; it&#8217;s about building killer websites. Who cares what the actual technology behind it is. They discussed a couple of what they seemed to consider the better frameworks available &#8211; Dojo and ExtJS. They then explored some amazing up and coming features, including offline support and 2D client side graphics manipulation.</p>
<p>I was rather impressed with jMaki &#8211; in short it is a wrapper around many of the popular JavaScript frameworks available (Dojo, Yahoo UI, Script.aculo.us, Spry, Google), and makes them accessible to Java, PHP, and Ruby. It has excellent tool support in NetBeans and Eclipse. It provides protection from changes in the API&#8217;s of all of these projects &#8211; you can mix and match frameworks and only be concerned about one API &#8211; jMaki&#8217;s. It does the work of linking all of the widgets together and communicating amongst them and with the server side.</p>
<p>The GWT talk was easily my favorite of the day. I&#8217;m extremely impressed with what these guys have done. I hadn&#8217;t had much opportunity to look at GWT until now, and I really wish I had. I was initially skeptical about writing an entire application in Java and letting it generate HTML and JavaScript. I guess these guys knew that, because they&#8217;re development philosophy addresses my concerns quite nicely:</p>
<p><span style="font-style:italic;"><br />To radically improve the web experience for<br />users by enabling developers to use existing<br />Java tools to build no-compromise AJAX for<br />any modern browser</span></p>
<p>From what I can see, they deliver on their mission. They&#8217;ve optimized their code for speed and for browser specificity (e.g. from what I understand, if your client is using Firefox, you get Firefox optimized JavaScript, same for IE, etc.). You can use all of your favorite IDE features to build the code, including the debugger. I really want to try to make use of this toolkit in the near future.</p>
<p>The final talk was less informative for me, but only because I had experience with most of the technologies already. The killer part of this was how the speaker extended existing JSF components and added Script.aculo.us effects. It really made his version of Yahoo maps shine.</p>
<p>Ajax isn&#8217;t going anywhere but up. I just left yet another Ajax/JSF session, which for me was the best session of the conference so far. In a later entry I&#8217;ll tell you why.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mattstine.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mattstine.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=31&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2007/05/10/wednesday-was-ajax-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>
	</item>
	</channel>
</rss>
