Just curious if anyone else has had problems utilizing a docked ApplicationControlBar.
My app's base state contains just a simple, standard Panel for login.
Once a user logs in I want there to be an ApplicationControlBar, docked at the top. However, I was getting error 2025 "The supplied DisplayObject must be a child of the caller." when switching from the base state to the logged-in state where the ACB is needed.
There is no error if the ACB is not set to dock=true, but for the design of my app, a control bar set at the top, that won't scroll, is essential.
I found a workaround by leaving the AddChild for the ACB in the state definition as dock=false, then calling a script from the effectEnd event of the last effect in the state transition sequence that adds the controls to the ACB and sets dock=true.
Now I am working on the logout coding and am running into problems, again with the docked ACB.
I started by having the logout button.click script be simply currentState="" and that resulted in the same 2025 error as before. (the logout button is in a GridItem in a custom component extending Grid that is a child of the ACB)
Then I tried adding this code to my logout script
Even after setting dock=false and removing the ACB's children, setting currentState="" still results in error 2025. The previous 3 lines execute without problem.
I found a couple references to similar issues:
Has anyone else dealt with this problem and have some suggestions for alternative solutions?
you've founded the bug in SDK and you can check the solving in Flex 4.
As a workaround you can try to change removing controlBar to setting it invisible and height = 0 (on logout) and setting visible and normal height on logon.
Thank you. Just changing the height/visibility instead of removing it in the state change works perfectly.