Home > GWT - GXT > GXT – RowLayout

GXT – RowLayout

Anyone who has worked so far with RowLayout in GXT, may have seen that the layout is not updated, e.g. if a component is visible or invisible. An example I have here.

I have a content panel with RowLayout and there is two components. A grid and a search panel. Search panel is not visible at the beginning.
When for example F4 – button clicks, I want to make it visible or invisible.

cpGrid = new ContentPanel(new RowLayout());
cpGrid.setHeaderVisible(false);
cpGrid.setBorders(false);
cpGrid.setBodyBorder(false);
cpGrid.setFrame(false);

searchPanel = new ContentPanel(new RowLayout());
grid = new GridBeanModel(store, getColumnModel());

cpGrid.add(searchPanel, new RowData(1, -1));
cpGrid.add(grid, new RowData(1, 1));

With a listener can achieve the desired functionality, as I wrote in my previous blog.
The problem here is that the layout is not updated and does not adjust its size if component is visible or invisible.
But the solution is simple.

cpView.getLayout().layout();

We add this code and everything works again.

Categories: GWT - GXT Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment