开发者

getChildren() not working for ViewStack in Flex

My Strucutre is like this.

<mx:ViewStack>
    <mx:HBox>
        <mx:Form>
            <mx:FormItem>
    .
 开发者_如何学Go   .
    .
    <mx:HBox>
        <mx:Form>
            <mx:FormItem>   
</mx:ViewStack> 

When I call the getChildren method on ViewStack, I only get the first HBox and not the others. How to get others as well?


An alternative is to set the creationPolicy of the viewStack to all, otherwise as far as Flex is concerned it only has one child. Setting it to 'all' creates all the children up front.

You could also keep a int variable with the number of children, and if any are added, increment that variable. Then use viewStack.selectedItem = ? in your code.


Since ViewStack hides tabs other than selected one, they aren't returned with getChildren(). Try numChildren and getChildAt(), it should help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜