There are other ways but here what I am doing:
<mx:FormItem width="100%" direction="horizontal" label="First Name"
required="true">
<mx:TextInput id="firstname"
focusOut="formatNames(firstname)"
text="{badgelist.selectedIndex==-1 ?
XML(badgelist.dataProvider.getItemAt(0)).firstname :
XML(badgelist.dataProvider.getItemAt(badgelist.selectedIndex)).firstname}"
width="100" restrict="A-z"/>
</mx:FormItem>
where badgelist is my DataGrid.
When form loads DG has first row highlighted and first row is detailed. Then
everytime you change selection you get new details shown.
Not sure if my code is the one to learn from but the approach works very well
for me.
HTH
--- In [email protected], Angelo Anolin <angelo_ano...@...> wrote:
>
>
> Hi. I am looking for a simple application where a datagrid is displayed.
> When the user clicks on the datagrid, the selected item's details is
> populated in a form element.
>
> I have no problem setting up the datagrid and populating it with XML data.
>
> I know that I need to map the itemClick event in the datagrid but since I am
> starting with Flex, I am not sure what kind of command to map to achieve
> this..
>
> Any sample codes would be extremely helpful. Thanks.
>
> Kind regards,
>
> Angelo
>