我使用的是:
private var _hrInfoView:ArrayCollection;
[Bindable]
public function get HRInfoView():ArrayCollection
{
return _hrInfoView;
}
public function set HRInfoView(value:ArrayCollection):void
{
_hrInfoView = value;
}
private function onFilterByContent(event:ContextMenuEvent):void
{
HRInfoView.filterFunction = processFilter;
HRInfoView.refresh();
//Break point here shows HRInfoView as different what is in line above. Why is setter not called?
}当我将断点放在HRInfoView的setter上时,它永远不会命中(当我可以在监视表达式中清楚地看到过滤前后HRInfoView发生了变化时)!为什么?谢谢。
发布于 2012-06-28 02:58:52
它不会调用setter,因为您没有设置该属性。您要做的就是调用getter,这样您就可以从它获取属性来设置它。HRInfoView.filterFunction和HRInfoView.refresh()都调用getter来获取_hrInfoView,然后从中调用函数或属性。
https://stackoverflow.com/questions/6300866
复制相似问题