PDA

View Full Version : [FIXED] RowLayout resizing issues



obender
13 Jun 2008, 10:53 AM
Here is the example code:



final Dialog testD = new Dialog()
{
{
this.setButtons( Dialog.OKCANCEL );
this.setHideOnButtonClick( true );
this.setWidth( 240 );
this.setHeight( 280 );
this.setHeading( "Test" );
}

@Override
protected void onRender( Element parent, int pos )
{
super.onRender( parent, pos );

this.setLayout( new FitLayout() );

LayoutContainer lc = new LayoutContainer();
lc.setLayout( new RowLayout() );

TabPanel tp = new TabPanel();
TabItem ti = new TabItem();
ti.setText( "Test Tab" );

tp.add(ti);

lc.add( new TextBox(), new RowData( 1, Style.DEFAULT ) );
lc.add( tp, new RowData( 1, 1 ) );

this.add( lc );
}
};

testD.show();
The dialog shows with content correctly sized but on resize the layout doesn't execute.


The following code fixes this particular issue but this is just a workaround for the problem:



testD.addListener( Events.Resize, new Listener<ComponentEvent>(){
public void handleEvent( ComponentEvent be ) {
testD.layout();
}
} );

darrellmeyer
13 Jun 2008, 11:25 AM
RowLayout was not monitoring container resizing. Fix is in SVN.

obender
13 Jun 2008, 12:01 PM
Thanks!