FlexTable in ScrollPanel still has no scroll bars

796 views
Skip to first unread message

Vitaly Trifanov

unread,
Mar 9, 2012, 7:03:58 PM3/9/12
to Google Web Toolkit
Hello.
I use DockLayoutPanel as root panel for my GWT app.
In it's center I have a FlexTable, and I want vertical scroll bar to
appear if content doesn't fit screen vertically.
I put a FlexTable into a ScrollPanel, but it doesn't work.

Please, help :)

Tomokiyo

unread,
Mar 11, 2012, 4:14:36 AM3/11/12
to Google Web Toolkit
It should just work. For example, the following works for me.

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.*;
import com.google.gwt.user.client.ui.*;

public class Bar implements EntryPoint {
public void onModuleLoad() {
final DockLayoutPanel dock = new DockLayoutPanel(Unit.EM);
final FlexTable table = new FlexTable();
final FlowPanel header = new FlowPanel();
header.add(new Button("Add row", new ClickHandler() {
public void onClick(ClickEvent event) {
table.setText(table.getRowCount(), 0, "foo");
}
}));
dock.addNorth(header, 5);
dock.add(new ScrollPanel(table));
RootLayoutPanel.get().add(dock);
Reply all
Reply to author
Forward
0 new messages