简体   繁体   English

如何对子bxml文件中的WTK组件进行数据绑定

[英]How to data-bind WTK component in child bxml file

I am using Apache Pivot 2.0.2 and I am trying to build a DesktopApplication. 我正在使用Apache Pivot 2.0.2,并且正在尝试构建DesktopApplication。

My problem is that I have a ListView or really - whatever object in my application, defined in bxml file. 我的问题是我有一个ListView或实际上-在我的应用程序中的任何对象(在bxml文件中定义)。 I can give it an ID or anything - no problem. 我可以给它一个ID或任何东西-没问题。

But now, how should I obtain this object in Java and affect changes I make to it? 但是现在,我应该如何用Java获取此对象并影响对它所做的更改?

Since my bxml are including other bxml files; 由于我的bxml包含其他bxml文件; after

this.window.open(display); this.window.open(display);

I have tried to obtain a certain object with: 我试图用以下方法获取某个对象:

bxmlSerializer.getNamespace().get("musicPanel"); bxmlSerializer.getNamespace()。get(“ musicPanel”);

And i can have the object with everything I put in BXML. 我可以将对象与BXML中的所有内容放在一起。 I can even change its properties BUT its not being reflected on the GUI! 我什至可以更改其属性,但不能在GUI上反映出来! Nothing changes! 没有什么变化!

So I thought I could find my object in the 所以我想我可以在

window.getContent(); window.getContent();

but I cannot find a method to get an object with ID. 但是我找不到找到具有ID的对象的方法。

Any help appreciated! 任何帮助表示赞赏!

Its hard to explain, but mainly I had to restructure my application and use my own namespace as in the example: 很难解释,但是主要是我不得不重组应用程序并使用自己的名称空间,如示例所示:

Stock Tracker Example 库存跟踪器示例

And it was useful to get the full sourcecode of these examples: 获得这些示例的完整源代码很有用:

Sourcecode 源代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM