1 Reply Latest reply on Sep 6, 2010 4:21 AM by SunilAdobe

    Unable to perform update, delete operations

    merlyn21828

      Hi,

       

      I am a newbie to flash builder. I am currently going through some of the tutorials and using Zend, WAMP.

      I developed a simple datagrid which is used to fetch the data from a mysql table ... also added a button which is used to delete the selected record.

      When i run the program, i can see the data but when i click on the delete button the data is deleted from the grid but not from the database. Would greatly appreciate your suggestions and recommendations on this.

       

      Source,

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:booktableservice="services.booktableservice.*">

      <fx:Script>

      <![CDATA[

      import mx.controls.Alert;

      import mx.events.FlexEvent;

       

      protected function dataGrid_creationCompleteHandler(event:FlexEvent):void

      {

      getAllBooktableResult.token = booktableService.getAllBooktable();

      }

       

       

      protected function Delete_clickHandler(event:MouseEvent):void

      {

      booktableService.deleteBooktable(dataGrid.selectedItem.MyID);

      }

       

      ]]>

      </fx:Script>

      <fx:Declarations>

      <s:CallResponder id="getAllBooktableResult"/>

      <booktableservice:BooktableService id="booktableService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

      <s:CallResponder id="deleteBooktableResult"/>

      <!-- Place non-visual elements (e.g., services, value objects) here -->

      </fx:Declarations>

      <mx:DataGrid x="179" y="49" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getAllBooktableResult.lastResult}">

      <mx:columns>

      <mx:DataGridColumn headerText="MyID" dataField="MyID"/>

      <mx:DataGridColumn headerText="Title" dataField="Title"/>

      <mx:DataGridColumn headerText="Image" dataField="Image"/>

      <mx:DataGridColumn headerText="Video" dataField="Video"/>

      <mx:DataGridColumn headerText="Description" dataField="Description"/>

      </mx:columns>

      </mx:DataGrid>

      <s:Button x="179" y="224" label="Delete" id="Delete" click="Delete_clickHandler(event)"/>

      </s:Application>