0

This is what's happening: I have a Tabnavigator with the following tab:

<s:NavigatorContent width="100%" height="100%" label="Add a logo" includeIn="loggedin">

<components:LogoSearch />

</s:NavigatorContent>

When I change the state to "loggedin" with following code:

protected function Login_getStateHandler(event:Event):void
        {
            this.currentState = "loggedin";
        }

the navigatorContent shows but not the component "LogoSearch", in design view however it does show when I switch states.

There are no states defined in "LogoSearch" and should show...?

When I include the tabnavigator in "normal" aswell as "loggedin", then change the state to "loggedin", the component "LogoSearch" shows. When I only show the tabnavigator in "loggedin", change the state to "loggedin", the component "LogoSearch" doesn't show.

Any idea why this is happening? I'm no pro in flex at all so feel free to point me on my mistake. Thanks.


Tried working with invalidateDisplayList() and invalidateProperties() as suggested by Tianzhen Lin. Still nothing showing.

<s:NavigatorContent width="100%" height="100%" label="Add a logo" includeIn="loggedin" id="AddLogoTab" >

    <s:Label text="test" id="test" />

</s:NavigatorContent>

And :

protected function Login_getStateRegisterHandler(event:Event):void
        {
            this.currentState = "register";
            test.invalidateDisplayList();
            test.invalidateProperties();
            test.validateNow();

            AddLogoTab.invalidateDisplayList();
            AddLogoTab.invalidateProperties();
            AddLogoTab.validateNow();
        }

Whatever I do, the content of the NavigatorContent won't show after statechange.

Tim Post
  • 33,371
  • 15
  • 110
  • 174
user1315134
  • 23
  • 1
  • 6

1 Answers1

0

To narrow down the problems you have, you may start by eliminating includeIn="loggedin" in your code, this would at least ensure that your component is showing properly.

Next, I would put a breakpoint at your Login_getStateHandler function, and see if it is ever called. If not, then it is somewhere in your wiring that the handler is not called. You may post more code here to get help.

Tianzhen Lin
  • 2,404
  • 1
  • 19
  • 19
  • Thanks for the reply. 'Login_getStateHandler' is called and the state does actually change, the element with the 'includeIn="loggedin"' shows because of the state change, but the component inside it does not show. I wouldn't really know what other code would be useful since the state does actually change ( no need to post the code that makes it happen ? ) and there are no states defined within the component 'LogoSearch'. If you have an idea what code I should show please tell me. Thanks again. – user1315134 Aug 11 '12 at 15:04
  • You might want to assign the width and height property of the component and see if it shows properly. Depending on how the component is written, so times it may not be able to assert the width and height it needs. You may also add a label with some text in the NavigatorContent, and see if it shows up. If neither shows, that means the ViewStack has not properly selected the NavigatorContent. In that case, an `invalidateDisplayList()` and `invalidateProperties()` may come in handy. – Tianzhen Lin Aug 11 '12 at 17:51
  • Thanks for the reply, sounded promising. I tried replacing the component with a label but the label didn't show either. – user1315134 Aug 12 '12 at 09:06
  • Do you house your `NavigatorContent` inside `mx:ViewStack`? If that is the case, it is likely your ViewStack does not have the `NavigatorContent` selected. – Tianzhen Lin Aug 12 '12 at 15:08