在我们打开面板之前,手风琴子控件为空
我正在使用 Flex AS3,我有一个带有两个选项卡的手风琴,每个选项卡包含一些文本框,我试图从位于手风琴外部的按钮事件处理程序访问这些子控件,问题是这些控件为空,直到我打开手风琴。
I am using Flex AS3, i have a accordian with two tabs each tab contains some text boxes and i am trying to access these child controls from button event handler which resides outside the accordian, Problem is these controls are null until i open the tabs of accordian.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将其添加到手风琴的 MXML 中,
然后它将在开始时创建所有内容,以便这些子项可供您参考。
Add this to the MXML of your accordion
It will then create everything at the beginning so those children will be there for you to reference.
您可以尝试以编程方式打开和关闭类似creationComplete 的手风琴,以强制在转发器中创建组件。我会其次避免重复。我发现只要有一点创造力,您就可以通过基本列表和自定义项目渲染做得更好。这使您可以更好地控制子组件的创建。
You could try programatically opening and closing the accordion on something like creationComplete to force the creation of the components in the repeater. I would second avoiding repeaters. I have found with a little creativity you can do much better with basic lists and custom item renders. This gives you a lot more control over the creation of the child components.