0
votes

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;                
        }
1
Offhand, that looks OK. I'm assuming _bProtocolsSelected is marked as [Bindable]? Could you post the content of isAllProtocolsSelected()? Are you sure that the function is returning the result you're expecting? - Jason Towne
Yes the variable is [Bindable]. And yes i am sure of the result of the function. I've putted several breakpoints and everything seems ok. I posted the content of the function - PsyKroPack
can you copy the actual declaration of the checkbox? - Dan
<mx:CheckBox layoutDirection="ltr" id="mx_chkBoxAllProtocols" label="Select / Unselect all" selected="{_bAllProtocolsSelected}" change="selectUnselectAllProtocols(mx_chkBoxAllProtocols.selected)"/> - PsyKroPack

1 Answers

0
votes

Make sure _bAllProtocolsSelected is declared [Bindable]. Hope this helps...