tablayoutpanel显示不正确

时间:2012-07-02 11:37:28

标签: gwt

我正在使用普通GWT并尝试在弹出式面板中显示tablayoutpanel但是当我显示弹出式面板时,布局完全搞砸了,我不知道是什么问题。如果你们中的任何人都可以告诉我这个鳕鱼有什么问题。

    <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
ui:generateKeys='com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator'
ui:generateLocales='default'>

<ui:style>
    .tabPanelExample1
    {
        margin: 10px;
    }
    </ui:style>

<!-- Defining constant variable for using VRS internationalisation messages --> 
<ui:with field='constants'    type='com.vermilionsoftware.vrsgwtp.client.VRSGWTConstants'/>

<g:DialogBox width="800" height="600">
    <g:HTMLPanel>
        <g:TabLayoutPanel ui:field="tabPanel" barUnit="PX"
            barHeight="60" width="375px" height="150px">
            <g:tab>
                <g:header>
                    UiBinder Tab 1
                </g:header>
                <g:HTML>
                    Hello tab 1
                    <br />
                    Good bye!
                </g:HTML>
            </g:tab>
            <g:tab>
                <g:header>
                    UiBinder Tab 2
                </g:header>
                <g:HTML>
                    <h2>Hello tab 2</h2>
                </g:HTML>
            </g:tab>
            <g:tab>
                <g:header>
                    UiBinder Tab 3
                </g:header>
                <g:HTML>
                    <strong>
                        <i>
                            <u>Hello tab number 3</u>
                        </i>
                    </strong>
                </g:HTML>
            </g:tab>
        </g:TabLayoutPanel>
    </g:HTMLPanel>
</g:DialogBox> 

MyView类是:

    public class ColourSelectorView extends PopupViewWithUiHandlers<ReportLayoutUiHandlers> implements ColourSelectorPresenter.MyView {

private final Widget widget;
private static ColourSelectorViewUIBinder uiBinder = GWT.create(ColourSelectorViewUIBinder.class);

public interface ColourSelectorViewUIBinder extends UiBinder<Widget, ColourSelectorView> {
}

@Inject
public ColourSelectorView(EventBus eventBus) {
super(eventBus);
widget = uiBinder.createAndBindUi(this);
}

@Override
public Widget asWidget() {
    return widget;
}

}

我的主持人是:

    public class ColourSelectorPresenter extends
    PresenterWidget<ColourSelectorPresenter.MyView> {

public interface MyView extends PopupView {
    // TODO Put your view methods here
}

@Inject
public ColourSelectorPresenter(final EventBus eventBus, final MyView view) {
    super(eventBus, view);
}

@Override
protected void onBind() {
    super.onBind();
}

@Override
protected void onReveal() {
    super.onReveal();

    Window.alert(this.getWidget().getElement().getInnerHTML());
}

}

1 个答案:

答案 0 :(得分:2)

尝试将TabLayoutPanel包裹在ResizeLayoutPanel而不是HTMLPanel中,或指定HTMLPanel的明确尺寸