<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
width="500" height="470"
creationComplete="myDataGrid.selectedIndex=0;"
>
<mx:Script>
<![CDATA[
// Model: XML structure describing
// some of the books in my collection.
[Bindable]
private var myBooks:XML =
<books>
<book ISBN="1590595181">
<title>Foundation ActionScript Animation:
Making Things Move</title>
<author>Keith Peters</author>
<amazonUrl>http://tinyurl.com/npuxt</
amazonUrl>
</book>
<book ISBN="1582346194">
<title>Send in the Idiots: Stories from the
Other Side of Autism</title>
<author>Kamran Nazeer</author>
<amazonUrl>http://tinyurl.com/lo5ts</
amazonUrl>
</book>
</books>
]]>
</mx:Script>
<!-- Keep track of the currently selected book -->
<mx:Number id="selectedBookIndex">{myDataGrid.selectedIndex}</
mx:Number>
<!-- User interface -->
<mx:Panel
title="Assigning XML data"
paddingBottom="10" paddingLeft="10" paddingRight="10"
paddingTop="10"
>
<!-- Master view: Display all books -->
<mx:DataGrid id="myDataGrid" dataProvider="{myBooks.book}">
<mx:columns>
<mx:DataGridColumn dataField="@ISBN" headerText="ISBN"
width="85"/>
<mx:DataGridColumn dataField="title"
headerText="Title"/>
<mx:DataGridColumn dataField="author"
headerText="Author"/>
<mx:DataGridColumn dataField="amazonUrl"
headerText="Web site">
<mx:itemRenderer>
<mx:Component>
<mx:LinkButton
label="Visit"
click="navigateToURL(new URLRequest
(data.amazonUrl), 'blank');"
/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
<!-- Detail view: Display currently selected book for editing
-->
<mx:Form width="100%" autoLayout="false">
<mx:FormHeading label="Edit book details"/>
<mx:FormItem label="ISBN:" width="100%">
<mx:TextInput
id="isbnInput"
width="100%"
text="{mybooks.book[selectedbookinde...@isbn}"
change="{mybooks.book[selectedbookinde...@isbn =
isbnInput.text}"
/>
</mx:FormItem>
<mx:FormItem label="Title:" width="
100%">
<mx:TextInput
id="titleInput"
width="100%"
text="{myBooks.book[selectedBookIndex].title}"
change="{myBooks.book[selectedBookIndex].title =
titleInput.text}"
/>
</mx:FormItem>
<mx:FormItem label="Author:" width="100%">
<mx:TextInput
id="authorInput"
width="100%"
text="{myBooks.book[selectedBookIndex].author}"
change="{myBooks.book[selectedBookIndex].author =
authorInput.text}"
/>
</mx:FormItem>
<mx:FormItem label="Amazon Url" width="100%">
<mx:TextInput
id="amazonUrlInput"
width="100%"
text="{myBooks.book[selectedBookIndex].amazonUrl}"
change="{myBooks.book[selectedBookIndex].amazonUrl
= amazonUrlInput.text}"
/>
</mx:FormItem>
</mx:Form>
</mx:Panel>
</mx:Application>
HTH
Anand
On Feb 27, 11:46 am, akshay <[email protected]> wrote:
> Hi Kalpesh,
> Thanks for replying.. I am not developing the AIR
> application .. :(
>
> Best Regards,
> Akshay
>
> On Feb 27, 11:42 am, kalpesh mahida <[email protected]> wrote:
>
> > Hi Akshay,
>
> > You are right flash player can not access file system so you need to send
> > your data to server side script but if you in AIR you can have access to
> > file system may the following link can explore out the idea better
>
> >http://livedocs.adobe.com/flex/3/html/help.html?content=Filesystem_08...
>
> > Kalpesh Mahida
>
> > On Fri, Feb 27, 2009 at 11:50 AM, akshay <[email protected]> wrote:
>
> > > Hi Kalpesh,
> > > Thanks for replying, according to u i have to send my
> > > data to server side to create XML document, am i right ??
> > > Is there only way to do this ?? Why this is so ?? Becoz of flex
> > > application does not have access to file system??
> > > Thanks in advance,
> > > Akshay
>
> > > On Feb 27, 10:11 am, kalpesh mahida <[email protected]> wrote:
> > > > Hi,
>
> > > > You can post your data to any server side script and then the your
> > > > server
> > > > side script can create XML file, there are several libraries available
> > > > in
> > > > every scripting language that can manipulate XML files
>
> > > > Kalpesh Mahida
>
> > > > On Thu, Feb 26, 2009 at 12:45 PM, akshay <[email protected]> wrote:
>
> > > > > Hi all,
> > > > > Pl reply to this post.. Thanks
> > > > > Akshay
>
> > > > > On Feb 26, 10:10 am, akshay <[email protected]> wrote:
> > > > > > Hi all,
> > > > > > I am developing one application in which i want to create
> > > > > > XML document where i want to save display object..
> > > > > > Can u tell me that how can i do it ?? Is there any API to create
> > > > > > document ??
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---