View Full Version : Portal sizing issues
Algiano
20 Jan 2009, 1:52 PM
Hi all,
I am having issue sizing a Portal to fit the full page. I have setup a Viewport and the Viewport takes a ContentPanel. This ContentPanel in turn contains a LayoutContainer and the LayoutContainer contains a Portal.
If I do the following the Viewport border will span the whole page:
1) add a plain ContentPanel to the LayoutContainer with FitLayout
2) add the LayoutContainer to the ContentPanel with FitLayout
3) add the ContentPanel to the Viewport with FitLayout
Now, if I replace the ContentPanel in step 1) with a Portal, all of a sudden the whole thing resizes to the height of the Portlets rather than the full screen which FitLayout normally does. You can tell because the south border of the Viewport no longer appears at the bottom of the page but instead appears straight after the Portlet (mid page).
Is this a bug? If I replace Portal with ContentPanel I get no issue (i.e. Viewport spans the full page) whereas if I use Portal, the Viewport seems to stop mid page.
Any help is appreciated.
Thanks,
Ale
Algiano
20 Jan 2009, 2:03 PM
Here goes:
public class MainEntryPoint implements EntryPoint {
public void onModuleLoad() {
ContentPanel viewPanel = new Dashboard();
Viewport vp = new Viewport();
vp.setLayout(new FitLayout());
vp.add(viewPanel);
RootPanel.get().add(vp);
}
}
public class Dashboard extends ContentPanel {
public Dashboard() {
this.setLayout(new FitLayout());
this.setHeaderVisible(false);
DashboardView view = new DashboardView(storage);
this.add(view);
}
}
public class DashboardView extends LayoutContainer implements DashletListener {
public DashboardView( StorageManager ls ) {
this.listener = ls;
this.setLayout(new FitLayout());
portal = new Portal(3);
portal.setBorders(false);
portal.setColumnWidth(0, .33);
portal.setColumnWidth(1, .33);
portal.setColumnWidth(2, .33);
this.add(portal);
/*ContentPanel portalPanel = new ContentPanel();
portalPanel.setLayout(new FitLayout());
portalPanel.setBorders(false);
portalPanel.setBodyBorder(false);
portalPanel.setHeaderVisible(false);
this.add(portalPanel);*/
}
}
This is what I am using to test. If I add the portal, then the borders will surround only the portal component and not the whole screen. If I uncomment the portalPanel and comment out the Portal, then the border spans the whole page.
THanks.
Ale
I dont understand what you mean. Post a screenshot showing the issue.
Algiano
20 Jan 2009, 2:24 PM
Sven,
PanelContent size shows what the borders look like when we have a ContentPanel. You can see it occupies the full area of the Viewport (this is not full screen because it's placed inside a Frame).
If you see the Portal size you will notice that the height is considerably reduced but it should be the same size as the previous screenshot.
Does it make more sense with the screenshots?
Thanks,
Ale
The screenshots say nothing to me. I tried you supplied code and it works great.
What gxt version are you using?
Algiano
20 Jan 2009, 2:36 PM
Sorry, just noticed the second screenshot isn't very accurate. The new version is correct.
If you look at the screenshots you see one has a toolbar and the border to the left goes from the toolbar all the way to the bottom of the browser.
In the new screenshot you see the border with a Portal instead of a ContentPanel. You can see that the left border is only the height of the Portal.
Not sure if I made any sense.
I dont have any issues with the code you provided. Also it seems as if the provided code isnt the code used in your screenshots.
Algiano
20 Jan 2009, 2:51 PM
Sven - the code is the same, the only difference is that it's placed within a Frame.
What gxt version are you using?
And what about that?
Algiano
20 Jan 2009, 2:57 PM
Currently using GXT 1.2.1 and GWT 1.5.3
Algiano
20 Jan 2009, 3:04 PM
Sorry! I forgot a piece of code:
Portlet p = new Portlet();
p.setHeading("Portlet");
portal.add(p, 0);
This is to add a portlet to the portal :)
Another thing, when this is run in a standard screen you actually see the Portal correctly. The issue is that if you do the same loading but inside a Frame you get the issue that I'm getting.
To replicate you can create a <FRAMESET> in your main html and then link that to another html page which contains the .js file.
Algiano
21 Jan 2009, 4:54 AM
Solved! Ok this was a really funny one.
I started methodically removing everything and magically the layout and the borders were in the right place. The issue was related to an AfterLayout event listener I had added to the Portlet. As soon as I removed the AfterLayout event everything worked as expected. The curious thing is that the AfterLayout method contained nothing.
Oh well, issue fixed. Sven thanks for your help!
Ale
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.