zoukankan      html  css  js  c++  java
  • flex 中actionScript不支持变量重命名

    public class VaultCloseCashBoxRecordFormPM extends BasePM
    {    
    /*========================================================*/
    /* Property */
    /*========================================================*/    
    
    /**原来的VO**/
    public var formerVO:VaultCloseCashBoxRecordVO;
    
    [Bindable]
    public var p_vo:VaultCloseCashBoxRecordVO = new VaultCloseCashBoxRecordVO();
    
    [Bindable]
    public var condi:Object = new Object;
    
    [Bindable]
    public var initFormDatas:Object = new Object(); 
    
    [Bindable]
    public var wxBoxList:ArrayCollection = new ArrayCollection();
    
    [Bindable]
    public var ljxBoxList:ArrayCollection = new ArrayCollection();
    //从前端要传到后台的机构id
    public var orgID:String;
    
    public function set vo(p_vo:VaultCloseCashBoxRecordVO):void
    {
    formerVO = p_vo;
    p_vo = ObjectUtil.copy(p_vo) as VaultCloseCashBoxRecordVO;
    
    //获得可封箱的尾箱与领缴款箱列表
    getBoxList();
    }public class VaultCloseCashBoxRecordFormPM extends BasePM
    {    
    /*========================================================*/
    /* Property */
    /*========================================================*/    
    
    /**原来的VO**/
    public var formerVO:VaultCloseCashBoxRecordVO;
    
    [Bindable]
    public var p_vo:VaultCloseCashBoxRecordVO = new VaultCloseCashBoxRecordVO();
    
    [Bindable]
    public var condi:Object = new Object;
    
    [Bindable]
    public var initFormDatas:Object = new Object(); 
    
    [Bindable]
    public var wxBoxList:ArrayCollection = new ArrayCollection();
    
    [Bindable]
    public var ljxBoxList:ArrayCollection = new ArrayCollection();
    //从前端要传到后台的机构id
    public var orgID:String;
    
    public function set vo(p_vo:VaultCloseCashBoxRecordVO):void
    {
    formerVO = p_vo;
    p_vo = ObjectUtil.copy(p_vo) as VaultCloseCashBoxRecordVO;
    
    //获得可封箱的尾箱与领缴款箱列表
    getBoxList();
    }

    上面的方法set vo中其中局部参数p_vo与成员参数p_vo就存在着变量重命名问题.这个代码一开始还不知道谁谁写的.一直按着java的思维去想.但是程序中数据延迟的bug总是修复不了.后来请教这方面的专家才发现是这个问题.后来只需要把代码修改如下,程序就正常了.虽然平时自己写代码的无乱在那种语言上都尽量避免写变量重命名的.因为这样代码实在容易有容易误会的地方.但是.别人这样写,你也是没办法的.所以还是了解一下好.相信javascript也是同样不支持变量重命名的.谨记.

     1 public class VaultCloseCashBoxRecordFormPM  extends BasePM
     2     {        
     3         /*========================================================*/
     4         /*   Property                                             */
     5         /*========================================================*/    
     6         
     7         /**原来的VO**/
     8         public var formerVO:VaultCloseCashBoxRecordVO;
     9         
    10         [Bindable]
    11         public var p_vo:VaultCloseCashBoxRecordVO = new VaultCloseCashBoxRecordVO();
    12         
    13         [Bindable]
    14         public var condi:Object = new Object;
    15         
    16         [Bindable]
    17         public var initFormDatas:Object = new Object(); 
    18         
    19         [Bindable]
    20         public var wxBoxList:ArrayCollection = new ArrayCollection();
    21         
    22         [Bindable]
    23         public var ljxBoxList:ArrayCollection = new ArrayCollection();
    24         //从前端要传到后台的机构id
    25         public var orgID:String;
    26         
    27         public function set vo(tempVO:VaultCloseCashBoxRecordVO):void
    28         {
    29             formerVO = tempVO;
    30             p_vo = ObjectUtil.copy(tempVO) as VaultCloseCashBoxRecordVO;
    31             
    32             //获得可封箱的尾箱与领缴款箱列表
    33             getBoxList();
    34         }
    35         


    盖士人读书,第一要有志,第二要有识,第三要有恒.有志则不甘为下流;有识则知学问无尽,不敢以一得自足,如河伯之观海,如井蛙之窥天,皆无识者也;有恒则断无不成之事.此三者缺一不可.
  • 相关阅读:
    Webbrowser 取消下载提示框
    The service ‘xxx’ configured for WCF is not registered with the Autofac container
    Code First 中的 TPH TPT TPC
    SQL Server 之 解锁
    导入 github 步骤
    初试 pyhton 简易采集
    js 一些小技巧
    linux 学习笔记
    lnmp 环境搭建后,pathinfo 模式支持的配制。
    windows 快捷键相关命令
  • 原文地址:https://www.cnblogs.com/fengxuanyuan/p/5863769.html
Copyright © 2011-2022 走看看