MACROMEDIA FLEX-GETTING STARTED WITH FLEX Manuel d'utilisateur Page 91

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 148
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 90
<mx:Button x="130" y="95" label="Get Shipping Options"
click="xmlRPC.send();"
width="160" height="22"/>
<mx:DataGrid dataProvider="{shippingInfo}"
x="80" y="141" width="262" height="92"
id="shippingOptionsList"
editable="false" enabled="true">
<mx:columns>
<mx:DataGridColumn headerText="Service"
dataField="service" />
<mx:DataGridColumn headerText="Price" dataField="price" />
</mx:columns>
</mx:DataGrid>
</mx:Application>
Now that we have the Flex client side of the code, let’s take a
look at what we need on the server.
The Server Code in ColdFusion
You can write the server code in whatever server technology
you like (e.g., PHP, Java, Rails, etc.). I’ve chosen to use Cold-
Fusion here, but you can find the code for the other server
models on the O’Reilly web page for this book.
The ColdFusion version of the text return page appears in
Example 5-5.
Example 5-5. PlainHttpService.cfm
<cfsetting enablecfoutputonly="true" />
<cfinvoke component="Shipping"
method="getShippingOptions" argumentcollection="#url#"
returnvariable="myResult" />
<cfloop index="i" from="1" to="#ArrayLen(myResult)#">
<cfoutput>#myResult[i].service#: #dollarFormat
(myResult[i].price)#<br
/></cfoutput>
</cfloop>
The XML version of the interface appears in Example 5-6.
Using the HTTPService Tag | 75
Vue de la page 90
1 2 ... 86 87 88 89 90 91 92 93 94 95 96 ... 147 148

Commentaires sur ces manuels

Pas de commentaire