Threaded View
-
24 Nov 2011 1:44 AM #1
BoxLayoutContainer adds all new widgets at position 0, not at the end
BoxLayoutContainer adds all new widgets at position 0, not at the end
HBoxLayoutContainer and VBoxLayoutContainer adds new widgets at position 0 (on top of each other), not at the end of the widget list, if widgets are added at runtime. Widgets get in place only after container gets resized.
rev 1806
First 5 ToggleButtons, that are being added in a constructor, are placed correctly, but when you click any of those buttons to add new at runtime, you will see that new buttons are being placed on top of the first button.
Code:public class GxtModule implements EntryPoint, ClickHandler { HBoxLayoutContainer hlc; @Override public void onModuleLoad() { RootPanel rootPanel = RootPanel.get(); hlc = new HBoxLayoutContainer(); rootPanel.add(hlc); for (int i = 0; i < 5; i++) { ToggleButton b = new ToggleButton("Button " + i); b.setLayoutData(new BoxLayoutData(new Margins(0, 5, 0, 0))); b.addDomHandler(this, ClickEvent.getType()); hlc.add(b); } } @Override public void onClick(ClickEvent event) { ToggleButton b = new ToggleButton("Button " + hlc.getWidgetCount()); b.setLayoutData(new BoxLayoutData(new Margins(0, 5, 0, 0))); b.addDomHandler(this, ClickEvent.getType()); hlc.add(b); } }
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote