flex flexlib windowsshade打开状态保持
我的 Flex + AIR 应用程序中的转发器中有 flexlib WindowShade 组件。
<mx:XML id="mainMenuXML">
<items>
<item value="abc" />
<item value="xyz" />
<item value="lmn" />
</items>
</mx:XML>
<mx:VBox width="100%" height="100%">
<mx:Button label="Button" click="button1_clickHandler(event)"/>
<mx:Repeater id="rep" dataProvider="{mainMenuXML.item}">
<flexlib:WindowShade label="{rep.currentItem.@value}" width="50%" opened="{rep.currentItem.@open}">
<mx:Label text="xxxxxxxxxx" />
</flexlib:WindowShade>
</mx:Repeater>
</mx:VBox>
现在,在 Button1 单击处理程序中,我在 XML(mainMenuXML) 中附加子项,从而添加了另一个 windowshade 实例。但问题是它打开了所有的windowshade实例。
添加新的 windowsshade 实例后,我需要保持打开的状态。 例如: 最初我得到 3 个带标签的遮阳帘:abc、xyz、lmn 全部打开。 现在我关闭 xyz windowsshade 实例(通过单击标题) 现在,我单击在 mainMenuXML 中附加子项的按钮,并添加带有一些标签“pqr”的窗帘实例。但现在我看到所有的windowshade实例都打开了。 但应该像 abc、lmn、pqr 应该打开 & xyz 关闭(属性打开=“假”)。
请帮助我维护 windowsshade 实例的打开真/假状态。
我尝试将 dataprovider Bindable 中的属性添加到windhowshade 的打开属性中,但对我不起作用。
提前致谢
I have flexlib WindowShade component in repeater in my Flex + AIR application.
<mx:XML id="mainMenuXML">
<items>
<item value="abc" />
<item value="xyz" />
<item value="lmn" />
</items>
</mx:XML>
<mx:VBox width="100%" height="100%">
<mx:Button label="Button" click="button1_clickHandler(event)"/>
<mx:Repeater id="rep" dataProvider="{mainMenuXML.item}">
<flexlib:WindowShade label="{rep.currentItem.@value}" width="50%" opened="{rep.currentItem.@open}">
<mx:Label text="xxxxxxxxxx" />
</flexlib:WindowShade>
</mx:Repeater>
</mx:VBox>
Now in button1 click handler I am appending child in XML(mainMenuXML) resulting adding one more windowshade instance. But the problem is it opens all the windowshade intances.
I need to maintain the opened states after adding a new windowshade instance.
For example:
Initially I get 3 windoshades with labels: abc, xyz, lmn all opened.
Now I close the xyz windowshade instance(by clicking on the header)
Now I click on button which appends child in mainMenuXML and also add a windowshade instance with some label "pqr". But now I see all the windowshade instances opened.
But it should be like abc, lmn, pqr should be opened & xyz closed(property opened="false").
Please help me in maintaining the opened true/false state of windowshade instances.
I tried to add a property in dataprovider Bindable to opened property of windhowshade but didn't worked for me.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望保留打开的值,则需要更改底层数据提供程序。所以你的说法非常正确。如果我没记错 WindowShade 组件,它在打开和关闭时不会调度事件,因此您可能需要扩展该组件才能添加此组件。我怀疑绑定是否有效,因为两个值之间存在循环依赖。
If you want the opened value to be persisted, you'll need to change the underlying dataprovider. So you are pretty much correct with that. If I remember the WindowShade component correctly, it didn't dispatch events when it opened and closed, so you may need to extend the component to add this. I doubt binding will work as you've got a circular dependency between the two values.