-1

I'm trying to hide Year2017 when the mxml page loads up. I'm using visible and includeInLayout attributes but it doesn't seems to be working.

Could somebody help me on this?

Some code written on - Year2017.mxml, Year2016.mxml, Year2015.mxml

MainScreen.mxml

<mx:HBox 
    <component:PopupOpenerViewStack
                id="payeVS" 
                borderStyle="none" 
                width="100%" 
                height="100%" 
                componentToFocusOn="{controlBar.overviewBut}"
                selectedIndex="{ this.mainModel.navigator.selectedIndex }" >

                <view1:Year2017 
                    width="100%" 
                    height="100%"
                    visible="{isVisible}" 
                    includeInLayout="{isVisible}" />

                <view1:Year2016 
                    width="100%" 
                    height="100%"/>

                <view1:Year2015 
                    width="100%" 
                    height="100%"/>                     
        </component:PopupOpenerViewStack>
</mx:HBox>  
Techie
  • 71
  • 1
  • 11

3 Answers3

0

The way viewstacks work is they display a child based on index. In this case it will be opened in an Popup. I'd need the internals of the PopupOpener to give an more accurate answer.

Instead of setting the isVisble, can't you change the this.mainModel.navigator.selectedIndex?

It also depends on desired behaviour. What needs to happen if you have the popup open and you change it to visible?

0

I guess what you want is that Year2007 is not included in the stack, would not that be invisible. Have you tried to use states for it?

jlebrato
  • 21
  • 5
0

Thanks for all your inputs.The issue is resolved.

As Robin mentioned the visible or includeInLayout properties wont work with PopupOpenerViewStack. So I had to read the index values of each item in the viewStack and did payeVS.removeChildAt(0) whenever I wanted to hide an element.

Thanks, Varatha

Techie
  • 71
  • 1
  • 11