• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

7. Flash Remoting and Java > 7.11. Databinding

Databinding

Chapter 3 discusses databinding Remoting RecordSet results to UI components using ActionScript DataGlue and DataProviderClass objects. Databinding is a powerful technique for streamlining Flash and server application integration.

Most enterprise Java applications encapsulate data access in a layer that hides JDBC code from business application classes. The data access layer accepts and returns business objects instead of JDBC ResultSets, which means that Remoting services in Java usually send collections of objects back to Flash instead of sending ResultSets. Collections of objects in Java become arrays of objects in Flash.

It would be great to be able to databind arrays of objects using DataGlue, just as we do RecordSets. Fortunately, this is quite easy with a class that extends the DataProviderClass implementation, RsDataProviderClass, that comes with the Flash Remoting components. The custom ArrayDataProvider, shown here, extends RsDataProviderClass by defining a constructor that takes an array as an argument and by defining a method, addAll( ), that calls the RsDataProviderClass implementation of addItem( ) to add each object in the array to the data provider:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint