0 Replies Latest reply on Jul 19, 2010 11:46 PM by visoul904

    a question about adding record to DB

    visoul904

      I tried to add a record to the DB of MSSQL2000. Then I set up a project of FLASH BULDER4.The application of server is COLD FUSION, using COLDFUSION FLASH REMOTING. Then I pulled a FORM to workspace, binded the DB and called the create service. But when I tried to add the record, there is no answer.

      <?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:valueObjects="valueObjects.*" xmlns:productsservice="services.productsservice.*">
       <fx:Script>
        <![CDATA[
         import mx.controls.Alert;
         
         protected function button_clickHandler(event:MouseEvent):void
         {
          var products2:Products = new Products();
          products2.item_name = item_nameTextInput.text;
          products2.carpet_type = carpet_typeTextInput.text;
          
          createproductsResult.token = productsService.createproducts(products2);
         }
         
        ]]>
       </fx:Script>
       <fx:Declarations>
        <valueObjects:Products id="products"/>
        <productsservice:ProductsService id="productsService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
        <s:CallResponder id="createproductsResult"/>
       </fx:Declarations>
       <mx:Form x="128" y="138" defaultButton="{button}">
        <mx:FormItem label="Id">
         <s:TextInput id="idTextInput" text="{products.id}"/>
        </mx:FormItem>
        <mx:FormItem label="Item_name">
         <s:TextInput id="item_nameTextInput" text="{products.item_name}"/>
        </mx:FormItem>
        <mx:FormItem label="Carpet_type">
         <s:TextInput id="carpet_typeTextInput" text="{products.carpet_type}"/>
        </mx:FormItem>
        <s:Button label="Createproducts" id="button" click="button_clickHandler(event)"/>
        <mx:Form>
         <mx:FormItem label="Createproducts">
          <s:TextInput id="createproductsTextInput" text="{createproductsResult.lastResult as Number}"/>
         </mx:FormItem>
        </mx:Form>
       </mx:Form>
      </s:Application>