通过字符串名称引用 Flashbuilder 视图
我有一个带有导航栏的 TabbedViewNavigator 应用程序,可以很好地打开视图。每个视图中都有一个 ButtonBar,它将打开与父视图相关的新视图。我有一个处理程序,它可以解码按钮的名称,并可以使用要打开的视图的名称构建一个字符串。我正在寻找某种方式从此字符串引用视图,其方式与 this["someName"]
或 getDefinitionByName("someName")
类似。在我的代码中,“this”指的是当前视图,而我需要查找的视图不是子元素。我不知道 getDefinitionByName()
在哪里查找,但它也找不到视图。
我已经用switch语句暂时解决了,但这不是一个好的解决方案。有没有查看合集;如果是这样,谁是该收藏品的所有者,或者我是否没有以正确的方式处理这个问题。
感谢您阅读本文。
I have a TabbedViewNavigator application with a navigatory bar which opens view just fine. In each view there is a ButtonBar that will open a new view related to the parent view. I have a single handler which decodes the name of the button and can build a string with the name of the view to be opened. I am looking for some way of referencing the view from this string, in a similar fashion to this["someName"]
or getDefinitionByName("someName")
. In my code, 'this' refers to the current view and the views that I need to find are not child elements. I don't know where getDefinitionByName()
is looking, but it can't find the view either.
I have solved it temporarily with a switch statement, but this is not a good solution. Is there a view collection; if so, who is the owner of the collection or am I not going about this in the correct way.
Thanks for reading this far.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果视图位于包/文件夹中,则需要向
getDefinitionByName
提供完整的包:If the view is in a package/folder, you need to supply the full package to
getDefinitionByName
: