Wednesday, July 12th, 2006

Adobe Spry and PHP/MySQL

Category: Adobe, Articles, JavaScript, Library

Mike Kornienko took Adobe’s Spry Framework for a spin.

He has written up his thoughts on integrating it with a PHP/MySQL backend:

Spry is Adobe’s Ajax library for manipulating XML data. It has some very unique and pretty useful functions like regions handling, related auto-updating data and stuff like that. For example, you can load XML file into your HTML document, created a template-like markup for with some spry: tags in it, and Spry will do the rest – will read the XML file and output it into your web-page in the format you have defined. Not only that. You can have several connected data sets so that when you select a row in the main table generated by Spry, and if you have a region on your web-page which is somehow depends on selected row in main table, this region will be updated automatically.

The article shows the XML that you give to Spry, the libraries involved, and the HTML components:

  1. <input type="button" value="sort id" onclick="dsTest.sort('id','toggle')""/>
  2. <input type="button" value="sort title" onclick="dsTest.sort('title','toggle')""/>
  3. <input type="button" value="sort content" onclick="dsTest.sort('content','toggle')""/>
  5. <div spry:region="dsTest">
  6. <table border="1">
  7. <tr spry:repeat="dsTest">
  8. <td>{@id}</td>
  9. <td>{name}</td>
  10. <td>{place}</td>
  11. </tr>
  12. </table>
  13. </div>

Posted by Dion Almaer at 7:20 am

3.3 rating from 77 votes


Comments feed TrackBack URI

Is it just me or is the post missing something?

Like the article link:


Comment by Bernard Sumption — July 12, 2006

Although this library is convenient, it has a problem with validation. It embeds invalid markup into the HTML and relies on the *generated* html to create a valid page. If there’s content needed by a web crawler or something, it won’t show up (which can happen on ajax-instensive pages).

It’s interesting to note that even though the markup starts as invalid (acc. to the w3c validator), the generated HTML from javascript switches the browser back into standards-compliance mode instead of quirks mode.

I guess I would just prefer not to rely on embedding the invalid markup into the HTML and separate the behaviors from the data. Here’s a good article on it:

Comment by Jon — July 13, 2006

I would be interested to see a direct comparison between Spry and Zapatec, which we are also considering. It seems that Spry is stronger on XML data-binding, but Zapatec is better for generating forms. Zapatec has some interesting widgets such as a slider control and conditional form display. Unfortunately they are both quite big libraries, so I am not sure that we will be able to use both of them.

Comment by Maija Johnstone — August 4, 2007

Leave a comment

You must be logged in to post a comment.