WEB开发网
开发学院图形图像Flash 跟我StepByStep学FLEX教程------Demo13之Fl... 阅读

跟我StepByStep学FLEX教程------Demo13之Flex访问数据库

 2009-09-09 00:00:00 来源:WEB开发网   
核心提示: Product.as(Flex页面使用类)package {//[Managed][RemoteClass(alias="com.samples.spring.store.Product")]public class Product{public function Produ

Product.as(Flex页面使用类)

package {
 //[Managed]
 [RemoteClass(alias="com.samples.spring.store.Product")]
 public class Product
 {
  public function Product()
  {
  }

  public var productId:int;

  public var name:String;

  public var category:String;

  public var price:Number;

  public var image:String;

  public var description:String;
  
  public var qtyInStock:int;

 }
}

ProductForm.mxml(列表的页面代码)

<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
 title="Details" width="100%" height="100%">
 
 <Product id="product"
  name="{productName.text}"
  category="{category.text}"
  price="{Number(price.text)}"
  qtyInStock="{int(qtyInStock.text)}"
  image="{image.text}"
  description="{description.text}"/>

 <mx:RemoteObject id="srv" destination="productService"/>

 <mx:Form width="100%">
 
  <mx:FormItem label="Name">
   <mx:TextInput id="productName" text="{product.name}"/>
  </mx:FormItem>
 
  <mx:FormItem label="Category">
   <mx:TextInput id="category" text="{product.category}"/>
  </mx:FormItem>
  
  <mx:FormItem label="Image">
   <mx:TextInput id="image" text="{product.image}"/>
  </mx:FormItem>
  
  <mx:FormItem label="Price">
   <mx:TextInput id="price" text="{product.price}"/>
  </mx:FormItem>

  <mx:FormItem label="In Stock">
   <mx:TextInput id="qtyInStock" text="{product.qtyInStock}"/>
  </mx:FormItem>
 
  <mx:FormItem label="Description" width="100%">
   <mx:TextArea id="description" text="{product.description}" width="100%" height="100"/>
  </mx:FormItem>
  
 </mx:Form>

 <mx:ControlBar>
  <mx:Button label="Update" click="srv.updateProduct(product)"/>
 </mx:ControlBar>

</mx:Panel>

上一页  1 2 3 4 5  下一页

Tags:StepByStep FLEX 教程

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接