-
17 Dec 2008 8:51 PM #1
[solved] Replicating the BorderLayout Example
[solved] Replicating the BorderLayout Example
I'm starting a fairly simple GXT project, and I'm using the BorderLayout for my page. I copied the source code for the BorderLayout example in the Ext GWT Explorer demo, but it doesn't work. Am I missing something obvious here?
- My class is called MainWindow, and it extends LayoutContainer.
- My onModuleLoad() method is simply:
- I did some debug printing, and the code definitely gets to the MainWindow class and executes it properly.Code:RootPanel.get().add(new MainWindow());
- However, nothing appears on the screen. I closed/restarted the Hosted Mode browser, and it still doesn't work.
- It gives me no errors. It gives me nothing at all.
- I've added the proper entries to my HTML and XML files. I changed my MainWindow to an Ext-GWT Button, and it works just fine. So, I think I did all of the Ext-GWT things alright.
I think I'm missing something small, but I can't tell what it is. Any ideas?Last edited by arosequi; 17 Dec 2008 at 9:03 PM. Reason: Solved
-
17 Dec 2008 9:03 PM #2
I think I got it fixed. At the end of the code for my MainWindow, I had to add a call to the show() method.
I'm assuming the Explorer demo does this one level above the source that it shows us, so I never saw it.
-
17 Dec 2008 9:14 PM #3
Yes, Window/Dialog needs to have show() called - all other widgets are added to a container or rootpanel
GXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender
-
18 Dec 2008 7:52 AM #4
Hello,
I'm having a similar issue but the remedy suggested so far, doesn't seem to make the example appear for me. Am I calling show() in the wrong place? Any help would be much appreciated.
Code:public void onModuleLoad() { RootPanel.get().add(new StageView()); }Code:package com.abc.client.view; import com.extjs.gxt.ui.client.Style.LayoutRegion; import com.extjs.gxt.ui.client.util.Margins; import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.extjs.gxt.ui.client.widget.layout.BorderLayout; import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData; public class StageView extends LayoutContainer { public StageView() { setLayout(new BorderLayout()); ContentPanel north = new ContentPanel(); ContentPanel west = new ContentPanel(); ContentPanel center = new ContentPanel(); ContentPanel east = new ContentPanel(); ContentPanel south = new ContentPanel(); BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 100); northData.setCollapsible(true); northData.setFloatable(true); northData.setSplit(true); northData.setMargins(new Margins(5, 5, 0, 5)); BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200); westData.setSplit(true); westData.setCollapsible(true); westData.setMargins(new Margins(5)); BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER); centerData.setMargins(new Margins(5, 0, 5, 0)); BorderLayoutData eastData = new BorderLayoutData(LayoutRegion.EAST, 200); eastData.setSplit(true); eastData.setCollapsible(true); eastData.setMargins(new Margins(5)); BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 100); southData.setSplit(true); southData.setCollapsible(true); southData.setFloatable(true); southData.setMargins(new Margins(0, 5, 5, 5)); add(north, northData); add(west, westData); add(center, centerData); add(east, eastData); add(south, southData); show(); } }
-
18 Dec 2008 12:36 PM #5
GXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender


Reply With Quote