-
26 Mar 2013 7:48 AM #1
[2.2.6] LayoutContainer does not add children to DOM (sometimes)
[2.2.6] LayoutContainer does not add children to DOM (sometimes)
I've noticed that it's possible for components added to a LayoutContainer to become "attached" (onAttach() is invoked) but never actually added to the DOM (el().isConnected() returns false). Is this a bug or am I misunderstanding something? To me it seems that when onAttach()/onLoad() is invoked, a widget's element should actually be part of the DOM.
Here is code to reproduce the problem (tested in FF and Chrome):
Code:import java.util.logging.Logger; import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.extjs.gxt.ui.client.widget.Text; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; public class Foo implements EntryPoint { private static final Logger logger = Logger.getLogger("Foo"); @Override public void onModuleLoad() { LayoutContainer parent = new LayoutContainer(); Widget child = new Text("Text") { @Override protected void onAttach() { super.onAttach(); if (isAttached() && !el().isConnected()) { logger.severe("Attached but not connected to DOM!"); } } }; // Add child to parent parent.add(child); // Add and remove parent RootPanel.get().add(parent); RootPanel.get().remove(parent); // Remove and re-add child parent.removeAll(); parent.add(child); // Add parent again -- child does not render RootPanel.get().add(parent); } }
-
26 Mar 2013 10:56 AM #2
As discussed here http://www.sencha.com/forum/showthread.php?259810-GXT-2.2.6-LayoutContainer-does-not-add-children-to-DOM-(sometimes) this is not a bug
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote