Legal
The views expressed in this blog are my own and do not necessarily reflect the views of Adobe Systems Incorporated.
Search
May 26, 2006
Drupal with Flex Using Flex / Ajax Bridge
I'm a big fan of Drupal, and one of the things that I've wanted to do lately is create a better UI to some of their elements. In particular, the watchdog module that shows you all the activity in your site really annoys me. To sort the elements you need to refresh every page.
Ever wonder what it would look like to use Flex components instead of an HTML table? Well, probably something like this:

As you can see, I've got a Flex data grid being populated by the data for the watchdog module. Now, its still very rough (for one, the Flash application doesn't resize to fit the space allowed to it), but you can still resize the columns, sort them with one click, drag and drop them etc...
I will post the code on Monday morning, but here's a brief outline of how I did it:
1. You'll need Flex Builder and the Flex AJAX Bridge, both available on Adobe Labs.
2. Override the table.php theme function. If you know Drupal, you know how to do this.
3. Output the JavaScript required for the Flex / AJAX bridge (use the code on this example page for creating and populating a datagrid) using PHP by looping through the data that is normally sent to the PHP templating function.
Its a little hard, but the results are great. One thing I'd love to see from the Drupal team is a better seperation of data and logic. For instance, in the table theme function, they pass in attributes for the HTML that gets outputted (nasty!) and some of the data has links embeded in it (great for outputting to HTML and linking to other pages, not so great for output in a different format, like Flash).
Comments
Hi Mike,
thanks for the example !
Mike,
I am a big fan of Drupal and I listened to your Boston Usergroup meeting. I was wondering if you posted the code for the admin panel somewhere? I would really like to spend some time figuring how all this works.
Thanks for all your contributions!
Jonathan
I have been reading your blog and I am exceptionally intrigued. I downloaded installed all the necessary flex products and ajax bridge but I am still a little confused by the example. I have been playing with it but have yet to get to that a ha moment. Your tips would be greatly appreciated. I guess I really would like to see your start on the integration your help would be greatly appreciated! This dog could really use a bone!! I looked for the source example but was not able to find it on your blog :(. Thanks!
Thank you for signing in, You may now comment. (Sign Out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)