PDA

View Full Version : Paging toolbar of Grid is not showing fully



babbarkrishan
23 Dec 2009, 6:20 AM
Hi,

I have created a grid and search form using Viewport as shown below in code:
public Viewport getViewport() {
Viewport viewport = new Viewport();
viewport.setScrollMode(Scroll.AUTO);
viewport.setLayout(new BorderLayout());
addSearchRegion(viewport, LayoutRegion.NORTH);
addGridRegion(viewport, LayoutRegion.CENTER);
return viewport;
}

private void addSearchRegion(Viewport in_viewport, LayoutRegion region) {
LayoutContainer container = new LayoutContainer();
container.setLayout(new FitLayout());
BorderLayoutData searchRegion = new BorderLayoutData(region, 170, 100, 170);
searchRegion.setMargins(new Margins(5, 5, 5, 5));
in_viewport.add(container, searchRegion);
container.add(createSearchPanel());
}

private void addGridRegion(Viewport in_viewport, LayoutRegion region) {
LayoutContainer gridContainer = new LayoutContainer();
gridContainer.setLayout(new FitLayout());
BorderLayoutData data = new BorderLayoutData(region, 100, 50, 100);
data.setMargins(new Margins(5, 5, 5, 5));
in_viewport.add(gridContainer, data);
gridContainer.add(createGridPanel());
}


Also, I am using TabPanel. In Tab2 I am showing grid and search form created above.
Here I am getting a problem. When user opens Tab2, it does not show paging toolbar of Grid on screen. Under all the browsers, the paging toolbar at the bottom is only half visible. See the attachement for more details.
I think it is due to FitLayout and TabPanel. Before using TabPanel, it was showing the whole page within the browser window. But when I use TabPanel, it moves the page below the browser window (at bottom) almost equal to the space taken by Tabs. I think FitLayout is not considering TabPanel. FitLayout just fit the components as per the browser window size fully without taking/considering the size of tabs shown on the page. Please anybody confirm if I am thinking right or not.

Please help to resolve it and show the whole page (including tabs) within browser window. Thanks in advance.

Please let me know in case required more information.

Thanks
Krishan Babbar

babbarkrishan
28 Dec 2009, 1:28 AM
Issue is resolved using following (bold text mainly) code:
LayoutContainer container = new LayoutContainer();
container.setLayout(new FitLayout());
BorderLayoutData data = new BorderLayoutData(region, 100, 50, 100);
data.setMargins(new Margins(5, 5, 30, 5));
in_viewport.add(container, data);
container.add(GridManager.getInstance().getGridPanel());


Thanks
Krishan Babbar