Skip to main content

Scrollable table with GWT

We came across a requirement to build a scrollable data table using Google Web Toolkit (GWT) because we had a limited space, but a growing table depending on the search criteria. As anyone can guess, having a scrollable table would be the best option. For that we used two components rather than one; com.google.gwt.user.client.ui.ScrollPanel and com.google.gwt.user.client.ui.FlexTable. The data table was added inside the Scrollable Panel.

For clarification, we have added the code below.
ScrollPanel scrollPanel = new ScrollPanel();
FlexTable dataTable = new FlexTable();

dataTable.setWidth("100%");
scrollPanel.add(dataTable);
scrollPanel.setSize("300", "200");

//add data to table
....

For setting width and height; it's advised to use css rules, but for ease of understanding we have shown some hard coded values here.

Comments

Post a Comment

We appreciate your opinions, suggestions and criticism.

Popular posts from this blog

Web Services with Apache Axis 1.4 Tutorial: server and client sides

Java Sorting: Comparator vs Comparable Tutorial

Creative Commons License Digizol by Kamal Mettananda is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License .
URL of this page must be supplied in attribution
© 2004-2017