<!---
Name:        flash6.cfm
Author:      Ben Forta (ben@forta.com)
Description: Flash data binding example
Created:     12/22/04
--->

<!--- Get movie list --->
<cfquery datasource="ows" name="movies">
SELECT *
FROM Films
ORDER BY MovieTitle
</cfquery>

<!--- Display data grid --->
<cfform format="flash" action="formdump.cfm">

<!--- Data grid --->
<cfgrid name="gridMovies"
        query="movies"
        rowheaders="no"
        height="200">
 <!--- Don't show all coluns --->
 <cfgridcolumn name="MovieTitle" header="Title">
 <cfgridcolumn name="PitchText" header="Tag Line">
</cfgrid>

<!--- Input fields --->
<cfinput type="text"
         name="MovieTitle"
         label="Title:"
         bind="{gridMovies.dataProvider[gridMovies.selectedIndex]['MovieTitle']}"
         onChange="gridMovies.dataProvider.editField(gridMovies.selectedIndex, 'MovieTitle', MovieTitle.text);">
<cfinput type="text"
         name="PitchText"
         label="Tag Line:"
         bind="{gridMovies.dataProvider[gridMovies.selectedIndex]['PitchText']}"
         onChange="gridMovies.dataProvider.editField(gridMovies.selectedIndex, 'PitchText', PitchText.text);">
<cfinput type="text"
         name="AmountBudgeted"
         label="Amount Budgeted:"
         bind="{gridMovies.dataProvider[gridMovies.selectedIndex]['AmountBudgeted']}"
         onChange="gridMovies.dataProvider.editField(gridMovies.selectedIndex, 'AmountBudgeted', AmountBudgeted.text);">
<cfinput type="text"
         name="ImageName"
         label="Image File:"
         bind="{gridMovies.dataProvider[gridMovies.selectedIndex]['ImageName']}"
         onChange="gridMovies.dataProvider.editField(gridMovies.selectedIndex, 'ImageName', ImageName.text);">
<cftextarea name="Summary"
            label="Summary:"
            rows="10"
            bind="{gridMovies.dataProvider[gridMovies.selectedIndex]['Summary']}"
            onChange="gridMovies.dataProvider.editField(gridMovies.selectedIndex, 'Summary', Summary.text);" />
<cfinput name="submitButton"
         type="submit"
         value="Save">
</cfform>
