-
29 Feb 2012 1:42 AM #1
I can't remove gxt grid component from ContentPanel
I can't remove gxt grid component from ContentPanel
Hello!
I have a view (in the mvp4g paradigm) which extends com.google.gwt.user.client.ui.Composite. In this view I made initWidget(grid). This view is added to ContentPanel component.
When I change views I do: contentPanel.removeAll() and contentPanel.add(newView).
It result in newView is added to ContentPanel, but grid isn't disappear. Moreother, grid becomes inactive. I can't select a row or resize header.
-
29 Feb 2012 2:53 AM #2
Workaround was found:
If I wrap grid with com.google.gwt.user.client.ui.FlowPanel, the removing works fine!
-
1 Mar 2012 4:00 PM #3
I can't seem to replicate this issue. ContentPanel doesn't have removeAll, so I used clear, and this seems to work just fine for removing a simple Composite consisting of a Grid.
What browser and OS are you using? Are you having this issue with development mode, production mode, or both? Also, would you be able to provide a simplified code example that implements EntryPoint?
-
1 Mar 2012 11:31 PM #4
com.extjs.gxt.ui.client.widget.ContentPanel doesn't have clear method.ContentPanel doesn't have removeAll, so I used clear
I have a bug in all browsers, production and dev. mode, Windows 7, gxt 2.2.5
EntryPoint code:
Problem class:Code:public void onModuleLoad() { Mvp4gModule module = (Mvp4gModule) GWT.create(Mvp4gModule.class); module.createAndStartModule(); final Viewport v = new Viewport(); v.setLayout(new FitLayout()); v.add((Widget) module.getStartView()); RootLayoutPanel.get().add(v); }
Code:public class MainView extends LayoutContainer implements MainPresenter.MainViewInterface, ReverseViewInterface<MainPresenter> { import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.LayoutContainer; private ContentPanel mainPanel = new ContentPanel(); private Widget defaultMainBody; private Widget activeView; public void setDefaultMainBody() { if (!defaultMainBody.equals(activeView)) { mainPanel.removeAll(); mainPanel.setHeading(getModuleTitle()); activeView = defaultMainBody; mainPanel.add(defaultMainBody); layout(); } } }
-
2 Mar 2012 12:38 AM #5
This is the GXT 3 bug forums, you are using GXT 2. I moved this thread to the proper location.
-
2 Mar 2012 12:39 AM #6
Can you please post a fully working testcase implementing EntryPoint without a reference to mvp4g?
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote