Flex:影响可绑定布尔值的函数结果不生成数据绑定事件
我有一个小问题。我可能误解了一些东西,但是当我这样做时:
public function listOfProtocolsModified():void
{
if (isAllProtocolsSelected())
{
_bAllProtocolsSelected = true;
}
else
{
_bAllProtocolsSelected = false;
}
_bModificationsMade = true;
}
我的 CheckBox 的 selected 属性根据 _bAllProtocolsSelected 值进行修改,但是当我这样做时:
public function listOfProtocolsModified():void
{
_bAllProtocolsSelected = isAllProtocolsSelected();
_bModificationsMade = true;
}
selected
属性永远不会更新...当然 isAllProtocolsSelected( )
返回一个布尔值。
有人知道发生了什么事吗?
这是请求的 isAllProtocolsSelected() 方法的内容
private function isAllProtocolsSelected():Boolean
{
var bAllActivated:Boolean = true;
for each (var protocol:Object in _listOfProtocols)
{
if (protocol[consts.DPIFILE_ACTIVATE_FIELD] == "0")
{
bAllActivated = false;
break;
}
}
return bAllActivated;
}
I have a small question. I am probably misunderstanding something, but when I do :
public function listOfProtocolsModified():void
{
if (isAllProtocolsSelected())
{
_bAllProtocolsSelected = true;
}
else
{
_bAllProtocolsSelected = false;
}
_bModificationsMade = true;
}
My CheckBox's selected property is modified according to _bAllProtocolsSelected value, but when I do:
public function listOfProtocolsModified():void
{
_bAllProtocolsSelected = isAllProtocolsSelected();
_bModificationsMade = true;
}
The selected
property is never updated... Of course isAllProtocolsSelected()
returns a Boolean value.
Anyone know what is happening?
Here is the content of the isAllProtocolsSelected() method as requested
private function isAllProtocolsSelected():Boolean
{
var bAllActivated:Boolean = true;
for each (var protocol:Object in _listOfProtocols)
{
if (protocol[consts.DPIFILE_ACTIVATE_FIELD] == "0")
{
bAllActivated = false;
break;
}
}
return bAllActivated;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保
_bAllProtocolsSelected
声明为[Bindable]
。希望这有帮助...
Make sure
_bAllProtocolsSelected
is declared[Bindable]
.Hope this helps...