MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guia do Utilizador Página 119

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 256
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 118
Create a dynamic link 119
You decide to create a dynamic link that opens a browser and displays the full content of the
post selected in the DataGrid.
1. In Source mode, change the click property in the <mx:LinkButton> tag so that the
application source looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="feedRequest.send()" layout="absolute">
<mx:HTTPService
id="feedRequest"
url="http://weblogs.macromedia.com/mchotin/index.xml"
useProxy="false" />
<mx:Panel x="10" y="10" width="475" height="400"
title="{feedRequest.lastResult.rss.channel.title}">
<mx:DataGrid id="dgPosts" x="20" y="20" width="400"
dataProvider="{feedRequest.lastResult.rss.channel.item}">
<mx:columns>
<mx:DataGridColumn headerText="Posts" dataField="title"/>
<mx:DataGridColumn headerText="Date" dataField="pubDate"
width="150" />
</mx:columns>
</mx:DataGrid>
<mx:LinkButton x="20" y="225" label="Read Full Post"
click="navigateToURL(new URLRequest(dgPosts.selectedItem.link));"/>
<mx:TextArea x="20" y="175" width="400"/>
</mx:Panel>
</mx:Application>
The value of the link field of the selected item in the DataGrid control,
dgPosts.selectedItem.link, is specified in the argument to the navigateToURL()
method, which is called when the user clicks the LinkButton control. The
navigateToURL() method loads a document from the specified URL in a new browser
window.
NOTE
The navigateToURL() method takes a URLRequest object as an argument, which in
turn takes a URL string as an argument.
Vista de página 118
1 2 ... 114 115 116 117 118 119 120 121 122 123 124 ... 255 256

Comentários a estes Manuais

Sem comentários