PDA

View Full Version : [2.2.0 Beta] RowLayout with Orientation.HORIZONTAL doesn't work everytime



maqjav
27 Aug 2010, 4:04 AM
Hello.

I'm having some troubles with this layout in different applications and with things that were working in previous versions of GXT.

Here is a simple example where Orientation.HORIZONTAL is ignored and all the items are added with VERTICAL orientation.



PopupPanel popUp = new PopupPanel();

ContentPanel panel = new ContentPanel(new AbsoluteLayout());
panel.setSize(450, 330);
panel.setHeading("TEXT");


LabelToolItem name = new LabelToolItem("User name");
name.setStyleName("black11 bold");
LabelToolItem password = new LabelToolItem("Password");
password.setStyleName("black11 bold");
LabelToolItem rePassword = new LabelToolItem("Rewrite password");
rePassword.setStyleName("black11 bold");

LayoutContainer row = new LayoutContainer(new RowLayout(Orientation.HORIZONTAL));
row.setSize(460, 16);
row.add(name, new RowData(220, 1));
row.add(password , new RowData(110, 1));
row.add(rePassword , new RowData(110, 1));

panel.add(row, new AbsoluteData(10, 20));

popUp.add(panel);
popUp.setPopupPositionAndShow(new PositionCallback() {

@Override
public void setPosition(int offsetWidth, int offsetHeight) {
popUp.setPopupPosition(Window.getClientWidth() / 2 - 230, Window.getClientHeight() / 2 - 165);
}
});


Edit: This problem exists only with Chrome, not with Internet Explorer.

Thanks.

sven
27 Aug 2010, 4:19 AM
The popuppanel is hidden while it gets shown. You need to add
panel.layout(true); as last line.

maqjav
27 Aug 2010, 4:28 AM
Great!, it's working now sven.

Thank you.

sven
27 Aug 2010, 4:45 AM
I am looking for a change so that this is not needed anymore.