Nov 5 2007

Model-Glue gets Flex/AIR Integration Features

Posted by Joe Rinehart at 7:25 AM
1 comments
- Categories: Flex | Model-Glue

It looks like ColdBox beat me to the punch on this one. I've been working on this since MAX, but I got hustling and committed the bits to the Model-Glue SVN ("bleeding edge") repository this morning.

There's a full blog entry about using this on the Model-Glue blog, as well as a 13-minute video of its use.

For those of you interested in the highlight reel, the following snippet shows how you'd use the new Model-Glue RemotingService (part of the application template) and the AS3 helper classes to read a Widget of a given WidgetId and display the Model-Glue trace of it being loaded:

<!-- Almost just like RemoteObject! -->
<modelglue:ModelGlueDelegate
   id="mgDelegate"
   source="myapp.RemotingService"
   destination="ColdFusion"
/>


<mx:Script><![CDATA[

// Get a widget
private function getWidget(widgetId:int):void
{
   mgDelegate.invokeEvent(
      "widget.get",
      {widgetId:widgetId},
      getWidgetResult
   );
}

private function getWidgetResult(e:ResultEvent):void
{
   var request:ProxyRequest = e.result as ProxyRequest;
   var widget:Widget = request.data.widget;

   Alert.show("You got widget: " + widget.name);
}

]]></mx:Script>

Enjoy!

Comments

Rob Rawlins

Rob Rawlins wrote on 11/06/07 4:17 AM

Joe old chap,

Are you able to give a bit of detail of the differances between MG:U and MG:Flex? I've not downloaded MG:Flex and had a play around yet. is it intended for Flex/Coldfusion intergration or is it simply for UI only?

I'm starting to find my feet with MG:U now and enjoying myself a great deal with it, and I'm also looking to expand my knowledge of Flex and would love to build the interface on top of an already working model glue domain model. Whats my best option with this kind of thing?

Thanks Joe,

Rob

Write your comment



(it will not be displayed)