使用flex中的httpservice方法与java进行交互(使用flex如何实现容器内元素的垂直居中对齐)一看就会

随心笔谈2年前发布 编辑
159 0
🌐 经济型:买域名、轻量云服务器、用途:游戏 网站等 《腾讯云》特点:特价机便宜 适合初学者用 点我优惠购买
🚀 拓展型:买域名、轻量云服务器、用途:游戏 网站等 《阿里云》特点:中档服务器便宜 域名备案事多 点我优惠购买
🛡️ 稳定型:买域名、轻量云服务器、用途:游戏 网站等 《西部数码》 特点:比上两家略贵但是稳定性超好事也少 点我优惠购买

layout=”vertical”

fontSize=”12″ viewSourceURL=”srcview/index.html” xmlns:s=”library://ns.adobe.com/flex/spark”>

import mx.collections.ArrayCollection;

import mx.controls.Alert;

import mx.events.FlexEvent;

import mx.events.ItemClickEvent;

import mx.rpc.events.FaultEvent;

[Bindable]

private var myAC:ArrayCollection;

private function faultHandler(event:FaultEvent):void

{

Alert.show(event.fault.faultString, event.fault.message);

}

// Function to filter out all items with gender

private function maleFilterFunc(item:Object):Boolean {

return item.gender==1;

}

// Function to apply the filter function the ICollectionView.

private function filterMale():void {

myAC.filterFunction=maleFilterFunc;

//Refresh the collection view to apply the filter.

myAC.refresh();

}

// Function to filter out all items with gender

private function femaleFilterFunc(item:Object):Boolean {

return item.gender==0;

}

// Function to apply the filter function the ICollectionView.

private function filterFemale():void {

myAC.filterFunction=femaleFilterFunc;

//Refresh the collection view to apply the filter.

myAC.refresh();

}

// Function to Reset the view to its original state.

private function resetAC():void {

myAC.filterFunction=null;

//Refresh the collection view.

myAC.refresh();

}

// Event handler function to display the selected button

private function filterHandler(event:ItemClickEvent):void {

switch(event.currentTarget.selectedValue){

case 1:

filterMale();

break;

case 0:

filterFemale();

break;

case 2:

resetAC();

break;

default:

break;

}

}

protected function bt1_clickHandler():void

{

myService.send();

}

]]>

showBusyCursor=”true”

url=”http://localhost:8089/flex_service_HttpService/wl/HttpService01″

result=”myAC=event.result.item.student”

fault=”faultHandler(event)”

contentType=”application/xml”

/>

dataProvider=”{myAC}” >

© 版权声明

相关文章