Hi,
your layout is wrong, try FormLayout like following:
Untitled.png
Code:
package ms.gwt.sample.client;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.user.client.Element;
public class QadDialogTest extends Dialog
{
public QadDialogTest()
{
setHeading( "QadDialogTest" );
setWidth( 600 );
setHeight( 300 );
setResizable( false );
setBodyStyle( "padding:20px" );
FormLayout layout = new FormLayout();
setLayout( layout );
Label descriptionLabel = new Label();
descriptionLabel.setText( "Please declare something." );
add( descriptionLabel );
final Radio radio1 = new Radio();
radio1.setBoxLabel( "Signed" );
radio1.setValue( true );
Radio radio2 = new Radio();
radio2.setBoxLabel( "Emergency" );
final RadioGroup rgGender = new RadioGroup();
rgGender.setHideLabel( true );
rgGender.add( radio1 );
rgGender.add( radio2 );
rgGender.setOrientation( Orientation.VERTICAL );
rgGender.setSelectionRequired( true );
add( rgGender );
add( new Html( "<b>Signed:</b>" ) );
add( new Html( "You have a signed Release of Information document." ) );
add( new Html( "<b>Emergency:</b>" ) );
add( new Html( "Emergency descr." ) );
setButtons( Dialog.OKCANCEL );
final Button btnContinue = getButtonById( Dialog.OK );
btnContinue.setText( "Contunue" );
btnContinue.addSelectionListener( new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected( ButtonEvent ce)
{
// some code
}
} );
addButton( btnContinue );
final Button btnCancel = getButtonById( Dialog.CANCEL );
btnCancel.addSelectionListener( new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected( ButtonEvent ce)
{
hide( btnCancel );
}
} );
addButton( btnCancel );
}
@Override
protected void onRender( Element parent, int pos)
{
super.onRender( parent, pos );
}
}
Best Regards.