MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Betriebsanweisung Seite 232

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 256
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 231
232 Use the Data Management Service
1. Add the following method declaration directly under the variable declarations to create an
event listener:
public function initApp():void {
}
2.
Add the boldface text to the initApp() method to create a DataService component and an
ArrayCollection object when the
initApp() method is called.
The
ds DataService connects to the server-side contact Data Management Service
destination, which is specified in its one argument.
public function initApp():void {
contacts = new ArrayCollection();
ds = new DataService("contact");
}
3.
Add the boldface text to the initApp() method to call the DataService object’s fill()
method when the
initApp() method is called.
The
fill() method requests data from the server-side Data Management Service
destination and fills the contacts ArrayCollection with that data. The DataService object
manages all updates, additions, and deletions to the data in the ArrayCollection.
public function initApp():void {
contacts = new ArrayCollection();
ds = new DataService("contact");
ds.fill(contacts);
}
4.
Add the boldface text to the <mx:Application> tag to call the initApp() method when
the contact application is initialized:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="initApp();">
Seitenansicht 231
1 2 ... 227 228 229 230 231 232 233 234 235 236 237 ... 255 256

Kommentare zu diesen Handbüchern

Keine Kommentare