Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I mix declarative and programmatic layout in GWT 2.0?
    primarykey
    data
    text
    <p>I'm trying to redo an existing panel that I made before GWT 2.0 was released. The panel has a few text fields and a scrollable panel below in a VerticalPanel. </p> <p>What I'd like to do is to make the scrollable panel with UIBinder and then add that to a VerticalPanel Below is an example I created to illustrate this:</p> <pre><code> public class ScrollTablePanel extends ResizeComposite{ interface Binder extends UiBinder&lt;Widget, ScrollTablePanel &gt; { } private static Binder uiBinder = GWT.create(Binder.class); @UiField FlexTable table1; @UiField FlexTable table2; public Test2() { initWidget(uiBinder.createAndBindUi(this)); table1.setText(0, 0, "testing 1"); table1.setText(0, 1, "testing 2"); table1.setText(0, 2, "testing 3"); table2.setText(0, 0, "testing 1"); table2.setText(0, 1, "testing 2"); table2.setText(0, 2, "testing 3"); table2.setText(1, 0, "testing 4"); table2.setText(1, 1, "testing 5"); table2.setText(1, 2, "testing 6"); } } </code></pre> <p>then the xml:</p> <pre><code>&lt;ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:mail='urn:import:com.test.scrollpaneltest'&gt; &lt;g:DockLayoutPanel unit='EM'&gt; &lt;g:north size="2"&gt; &lt;g:FlexTable ui:field="table1"&gt;&lt;/g:FlexTable&gt; &lt;/g:north&gt; &lt;g:center&gt; &lt;g:ScrollPanel&gt; &lt;g:FlexTable ui:field="table2"&gt;&lt;/g:FlexTable&gt; &lt;/g:ScrollPanel&gt; &lt;/g:center&gt; &lt;/g:DockLayoutPanel&gt; &lt;/ui:UiBinder&gt; </code></pre> <p>Then do something like this in the EntryPoint:</p> <pre><code> public void onModuleLoad() { VerticalPanel vp = new VerticalPanel(); vp.add(new ScrollTablePanel()); vp.add(new Label("dummy label text")); vp.setWidth("100%"); RootLayoutPanel.get().add(vp); } </code></pre> <p>But when I add the ScrollTablePanel to the VerticalPanel, only the first FlexTable (test1) is visible on the page, not the whole ScrollTablePanel. </p> <p>Is there a way to make this work where it is possible to mix declarative and programmatic layout in GWT 2.0?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload