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         

 


posted @ 2016-09-12 09:59  帅如风  阅读(234)  评论(0编辑  收藏  举报