Post new topic Reply to topic  [ 3 posts ] 

Board index : GWT-Ext Forums : GWT-Ext 2.x Discussion

Author Message
 Post subject: [CLOSED] BorderLayout problem with nested panels
PostPosted: Thu Mar 13, 2008 6:00 pm 
Offline

Joined: Thu Mar 13, 2008 5:38 pm
Posts: 28
Hi,
the following code:

Code:
public void onModuleLoad() {
  Panel mainPanel = new Panel();
  mainPanel.setLayout( new BorderLayout() );
  Panel nestedPanel = new Panel();
  nestedPanel.setLayout( new BorderLayout() );
  mainPanel.add( nestedPanel, new BorderLayoutData( RegionPosition.CENTER ) );
  new Viewport( mainPanel );
}


produces the following error:

com.google.gwt.dev.shell.HostedModeException: invokeNativeHandle(@com.gwtext.client.widgets.Viewport::create(Lcom/google/gwt/core/client/JavaScriptObject;)): JavaScript undefined, expected com.google.gwt.core.client.JavaScriptObject
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:101)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeHandle(ModuleSpace.java:226)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeHandle(JavaScriptHost.java:89)
at com.gwtext.client.widgets.Viewport.create(Viewport.java:65)
at com.gwtext.client.widgets.Viewport.<init>(Viewport.java:46)
at com.cubusmail.gwtui.client.Cubusmail.onModuleLoad(Cubusmail.java:60)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:342)
at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:326)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$200(BrowserWidgetIE6.java:36)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:70)

If the nested panel has an other layout, it works. What is the problem? Any help would be appreciated.

Thanks


Regards,
Jürgen


Back to top
 Profile  
 
 Post subject: Re: BorderLayout problem with nested panels
PostPosted: Thu Mar 13, 2008 11:35 pm 
Offline
Site Admin

Joined: Fri Dec 14, 2007 12:27 pm
Posts: 1017
Hi Jurgen,
When using a BorderLayout, you must have a Panel assigned to the CENTER region at the very minimum. This is a requirement.

I've added this to the BorderLayout javadocs

Note that when using BorderLayout, you must have a Panel assigned to the CENTER region.

So try this

Code:
    public void onModuleLoad() {
        Panel mainPanel = new Panel();
        mainPanel.setLayout(new BorderLayout());
        Panel nestedPanel = new Panel();
        nestedPanel.setLayout(new BorderLayout());

        //add a center panel to the nested panel
        nestedPanel.add(new Panel("Inner"), new BorderLayoutData(RegionPosition.CENTER));

        mainPanel.add(nestedPanel, new BorderLayoutData(RegionPosition.CENTER));
        new Viewport(mainPanel);
    }


Sanjiv


Back to top
 Profile  
 
 Post subject: Re: [CLOSED] BorderLayout problem with nested panels
PostPosted: Fri Mar 14, 2008 5:21 pm 
Offline

Joined: Thu Mar 13, 2008 5:38 pm
Posts: 28
Hi Sanjiv,
thanks a lot for the quick help. It works. Great support for a great tool kit.

Jürgen


Back to top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

Board index : GWT-Ext Forums : GWT-Ext 2.x Discussion


Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Style by Midnight Phoenix & N.Design Studio
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.