2010-08-11 17 views
0

我在使用UiBinder顯示SplitLayoutPanel時遇到了一些麻煩。看起來SplitLayoutPanel在頁面加載時隱藏。由於UiBinder和SplitLayoutPanel不顯示

這裏是我的代碼:

<!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" 
    xmlns:z="urn:import:com.zimfly.filebox.client" 
    > 
    <ui:style> 
      .mainPanel { 
        background-image: url("images/bg.jpg"); 
        background-repeat:repeat-x; 
      } 
    </ui:style> 


    <g:ScrollPanel styleName="{style.mainPanel}"> 

      <g:HTMLPanel> 

        <br></br> 

        <g:VerticalPanel> 
          <g:HorizontalPanel> 
            <g:HTML>&nbsp;&nbsp;</g:HTML> 
            <g:Button ui:field="btnToggleUpload">Show Upload Form</g:Button> 
            <g:HTML>&nbsp;&nbsp;</g:HTML> 
            <g:Button ui:field='btnNewFolder'>New Folder</g:Button> 
          </g:HorizontalPanel> 


        </g:VerticalPanel> 

        <br></br> 

        <g:SplitLayoutPanel>  
          <g:west size="300" unit='EM'> 
            <z:FilesTree ui:field="filesTree" /> 
          </g:west> 
          <g:center> 
            <z:FilesGrid ui:field="filesGrid" /> 
          </g:center> 
        </g:SplitLayoutPanel> 
      </g:HTMLPanel> 
    </g:ScrollPanel> 
</ui:UiBinder> 
+0

我已添加到我的答案中。 – Strelok 2010-08-12 00:27:56

+0

另外,這個問題可能會有所幫助:http://stackoverflow.com/questions/2495457/cant-get-splitlayoutpanel-working-gwt-uibinder-are-driving-me-crazy – 2010-08-12 06:43:53

回答

1

首先,檢查DOCTYPE聲明主機頁面上指示瀏覽器使用standards mode

編輯:看起來像你的案例中的SplitLayoutPanel需要一個定義的height值。

<!DOCTYPE html>

+0

戰爭目錄中的主頁有<!DOCTYPE html> 謝謝 – clarity 2010-08-11 23:53:40

+0

我添加了一個高度和寬度並顯示了SplitLayoutPanel – clarity 2010-08-12 21:50:33