MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guide de l'utilisateur Page 233

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 256
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 232
Build a distributed application with the Java adapter 233
Verify that your code is correct
Your code should match the following code example. Verify that the content is correct and
save the lesson2.mxml file.
<?xml version="1.0" ?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="initApp();">
<mx:Script>
<![CDATA[
import mx.data.DataService;
import mx.collections.ArrayCollection;
import samples.contact.Contact;
public var ds:DataService;
[Bindable]
public var contacts:ArrayCollection;
public var contact:Contact;
public function initApp():void {
contacts = new ArrayCollection();
ds = new DataService("contact");
ds.fill(contacts);
}
]]>
</mx:Script>
<mx:DataGrid id="dg" dataProvider="{contacts}" editable="true">
<mx:columns>
<mx:DataGridColumn dataField="contactId" headerText="Id"
editable="false"/>
<mx:DataGridColumn dataField="firstName" headerText="First Name"
/>
<mx:DataGridColumn dataField="lastName" headerText="Last Name"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
Run the completed contact application
In this section, you run the completed contact application in two browser windows to see
automatic updates in one window when data changes in the other.
1. Run the application in two browser windows.
Vue de la page 232
1 2 ... 228 229 230 231 232 233 234 235 236 237 238 ... 255 256

Commentaires sur ces manuels

Pas de commentaire