GWT TabLayoutPanel 始终折叠
我有一个用 UIBinder 制作的简单 TabLayoutPanel。选项卡会呈现,但内容不会呈现。它位于 HTML 中,但总是折叠的(元素上设置的内联样式使其折叠)。据我所知,这与我见过的每个 TabLayoutPanel 示例都是相同的。其他小部件渲染良好。该项目只是删除了默认 HTML 和代码的基本示例。
XML 是:
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<g:TabLayoutPanel barHeight='22' barUnit='PX'>
<g:tab>
<g:header>Tab A</g:header>
<g:HTML>
asdf
<p>asdfasdf</p>
</g:HTML>
</g:tab>
<g:tab>
<g:header>Tab B</g:header>
<g:Label>blah</g:Label>
</g:tab>
<g:tab>
<g:header>Tab C</g:header>
<g:Label>blah</g:Label>
</g:tab>
</g:TabLayoutPanel>
</ui:UiBinder>
Java 是:
public class Main extends Composite {
private static MainUiBinder uiBinder = GWT.create(MainUiBinder.class);
interface MainUiBinder extends UiBinder<Widget, Main> {
}
public Main() {
initWidget(uiBinder.createAndBindUi(this));
}
}
我将它添加到我的应用程序中,如下所示:
public void onModuleLoad() {
RootPanel.get().add(new Main());
}
我惊呆了。这应该很简单。我一定是错过了一些愚蠢的事情。有什么想法吗?
I have a trivial TabLayoutPanel made with a UIBinder. The tabs render but none of the contents do. It's in the HTML, but it's always collapsed (inline styles set on the elements make it collapse). As far as I can tell this is identical to every TabLayoutPanel example I've seen. Other widgets render fine. The project is just the basic example with the default HTML and code stripped out.
The XML is:
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<g:TabLayoutPanel barHeight='22' barUnit='PX'>
<g:tab>
<g:header>Tab A</g:header>
<g:HTML>
asdf
<p>asdfasdf</p>
</g:HTML>
</g:tab>
<g:tab>
<g:header>Tab B</g:header>
<g:Label>blah</g:Label>
</g:tab>
<g:tab>
<g:header>Tab C</g:header>
<g:Label>blah</g:Label>
</g:tab>
</g:TabLayoutPanel>
</ui:UiBinder>
And the Java is:
public class Main extends Composite {
private static MainUiBinder uiBinder = GWT.create(MainUiBinder.class);
interface MainUiBinder extends UiBinder<Widget, Main> {
}
public Main() {
initWidget(uiBinder.createAndBindUi(this));
}
}
And I'm adding it to my app like this:
public void onModuleLoad() {
RootPanel.get().add(new Main());
}
I'm stunned. This should be trivially easy. I must be missing something stupid. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将其添加到 RootLayoutPanel。
并且不要忘记在 html 中使用正确的 DOCTYPE。
Add it to RootLayoutPanel.
And dont forget to use correct DOCTYPE in your html.