MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Manual do Utilizador Página 98

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 124
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 97
TUTORIALS POINT
Simply Easy Learning Page 93
<items>
<item name="Book" description="History of France"></item>
<item name="Pen" description="Parker Pen"></item>
<item name="Pencil" description="Stationary"></item>
<items>
HTTPService Declaration
Now declare a HTTPService and pass it url of the above file
<fx:Declarations>
<mx:HTTPService id="itemRequest"
url="http://www.tutorialspoint.com/flex/Items.xml" />
</fx:Declarations>
RPC Call
Make a call to itemRequest.send() method and bind values from lastResult object of itemRequest webservice to
Flex UI component.
...
itemRequest.send();
...
<mx:DataGrid id="dgItems" height="80%" width="75%"
dataProvider="{itemRequest.lastResult.items.item}">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name"/>
<mx:DataGridColumn headerText="Description" dataField="description"/>
</mx:columns>
</mx:DataGrid>
RPC Service Call Example
Now Let us follow the following steps to test RPC services in a Flex application:
S.N.
Description
1
Create a project with a name HelloWorld under a package com.tutorialspoint.client as explained in
the Flex - Create Application chapter.
2
Modify HelloWorld.mxml as explained below. Keep rest of the files unchanged.
3
Compile and run the application to make sure business logic is working as per the requirements.
Following is the content of the modified mxml file src/com.tutorialspoint/HelloWorld.mxml.
<?xml version="1.0" encoding="utf-8"?>
Vista de página 97
1 2 ... 93 94 95 96 97 98 99 100 101 102 103 ... 123 124

Comentários a estes Manuais

Sem comentários