GWT uiBinder.createAndBindUi(this) 帮助
我是 Java GWT 插件的新手。
在我们的代码中,我们使用如下代码,
在 test1.java 中
public class RowResults extends Composite
{
@UiField VerticalPanel vpnlWidgets;
public RowResults()
{
uiBinder.createAndBindUi(this));
getRows();
}
private void getRows()
{
for(RowDetails obj: RowDetailsArray)
{
RowWidget row= new RowWidget(obj);
vpnlWidgets.add(row);
}
}
}
,在 test2.java 中,
public RowWidget(RowDetails rowObj)
{
uiBinder.createAndBindUi(this);
this.Row = rowObj;
}
我在这里发布了一些必要的代码。在此代码中,如果 RowDetailsArray 有 10 个元素,则为每个元素调用 createAndBindUi。看起来也有些慢。
有没有办法调用 uiBinder.createAndBindUi(this);函数一次并将其用于所有 10 个元素。
另外,调用 createAndBindUi(this) 时会发生什么。是否将 ui.xml 文件转换为类文件或其他文件。
如果我错了,请纠正我。,
提前致谢。
I am new to Java GWT plugins.
In our code, we are using code like below,
In test1.java
public class RowResults extends Composite
{
@UiField VerticalPanel vpnlWidgets;
public RowResults()
{
uiBinder.createAndBindUi(this));
getRows();
}
private void getRows()
{
for(RowDetails obj: RowDetailsArray)
{
RowWidget row= new RowWidget(obj);
vpnlWidgets.add(row);
}
}
}
In test2.java
public RowWidget(RowDetails rowObj)
{
uiBinder.createAndBindUi(this);
this.Row = rowObj;
}
I have posted here some necessary code. In this code, if I have 10 elements in RowDetailsArray, then for each elements createAndBindUi is called. It seems somewhat slow also.
Is there any way to call uiBinder.createAndBindUi(this); function one time and use that for all the 10 elements.
Also, what will happen while calling createAndBindUi(this). Whether it convert ui.xml file to class file or some thing else.
Pls Correct me if I am wrong.,
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想这取决于您的
RowWidget
的复杂程度。如果它没有特殊的样式,我建议使用FlexTable
代替,然后在其中插入行。这是相当优化的。I guess it depends on how complicated your
RowWidget
is. If it has no special styling, I would suggest to use aFlexTable
instead and just insert rows in it. It is quite optimized.使用此代码格式。
Use This Code Format.