879
社区成员
发帖
与我相关
我的任务
分享
<?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.id = parseFloat(idTextInput.text);
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>
这么老的帖子还在上面呆着啊。