flex开发积累

1、设置formitem中标签与表单组件之间的距离indicatorGap,实例如下:

 

    <mx:FormItem label="详细配置:"  indicatorGap="0">
     <s:DropDownList id="detailSetting" width="200" color="#565656"  dataProvider="{detailSettings}" labelField="label"/>
    </mx:FormItem>

2、在鼠标经过List的某一项时,将其浅蓝色的背景去掉

     可以在<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    height="200" width="200"
    mouseOver="simulateItemMouseover()"
    click="simulateItemClick()"
    autoDrawBackground="false">中将autoDrawBackground设置为false即可;

3、flex弹出的窗口不带有遮罩层,PopUpManager.createPopUp(this,AlarmPointMonitorWidget,false)

     只要将第三个参数设置为false即可。 此参数是设置模式modal的!

4、Java与flex类型映射问题

     Java端的方法public String saveStationInfo(EmgEventStationInfo stationInfo)

     flex端的通过remoteobject调用Java端的上述方法(flex端已经定义好与Java实体对应的实体类EmgEventStationInfo.as);

     报了如下异常:

           "Client.Message.Deserialize.InvalidType" faultDetail = (null)
    faultString = "Cannot convert type flex.messaging.io.amf.ASObject with remote type specified as 'null' to an instance of class zxt.xj.bean.EmgEventStationInfo"

     解决方案:在EmgEventStationInfo实体类中添加了[RemoteClass(alias="com.bozch.EmgEventStationInfo ")] ;

 

5、flex的ArrayCollection与Java中ArrayList之间的映射

     从flex前端传给java的ArrayCollection是不能够直接映射成相应的ArrayList,需要进行转换;                     

    public ArrayList    convertArrayCollection(ArrayCollection array) {
           ArrayList target = new ArrayList();
  ASTranslator ast = new ASTranslator();
  EmgEventMonitorFactor myClass;
  ASObject aso;

  for (int i = 0; i < array.size(); i++) {
      myObject = new EmgEventMonitorFactor();
      aso = new ASObject();

      aso = (ASObject) array.get(i);
      aso.setType("包路径.EmgEventMonitorFactor");
      myClass = (EmgEventMonitorFactor) ast.convert(aso, EmgEventMonitorFactor.class);
      target.add(myClass);
     }
     return target;
 }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值