Creator Tip: Using CSS Layout Technique
Some Creator customers have asked if the page-fragments can be placed such a way that a single page can be subdivided in to 4 parts:
The best approach is to provide a Layout Component to lay out the components added to it, may be using a <table> element. In the absence of such a component, let us see how this can be done. Here is a hint on how to achieve this using CSS Layout Technique.
Let us use three page-fragments for header, footer and side navigation bar. For the middle let us use a LayoutPanel with Grid-Layout so that user can set the components in absolute layout mode. Now do the following
Page Fragment1
Page Fragment2
Page Fragment3
Note: Percentage works fine in Firefox but fails in IE6. So better to use pixels than percentage at least for Page Fragment height, to support correctly in IE. The height and width can be set using the property sheet of each page fragment.
The components can be added to the page fragments in the usual manner. I've added StaticText with some text that displays location of the page-fragment and the Layout Panel.
Add the following to the resources/stylesheet.css
.top{
background-color: #ccccff;
bottom: auto;
height: 10%;
left: 0;
position: fixed;
right: 0;
top: 0;
width: 100%
}
.left{
background-color: #ffffcc;
color: #000000;
height: 80%;
left: 0;
position: fixed;
top: 10%;
width: 20%;
overflow : auto
}
.bottom {
background-color: #ccffcc;
bottom: 0;
height: 10%;
position: fixed;
right: 0;
top: auto;
width: 100%
}
Now add the three page-fragments to a page. When each page-fragment is added an enclosing <div> is added for each page-fragment in the page. This is visible in the outline. Select the <div> in the out line and unset the style property on each of the <div> (Note: This is import other wise settings in the style property takes precedence. Now set the styleClass of each page-fragment as top for header , left for navigation, bottom for footer.
Add a LayoutPanel to the page. Set its style property as
background-color: #abaaed; position: absolute; width: 80%; height: 80%; left: 20%; top: 10%
If you deploy the application you should see something like in the picture below. Try resizing the page in the browser and see the results. If percentage is used, the resizing of the page fragments will be much more fluid (works well in Firefox).
PS: I've tested this only with Firefox and IE 6. Firefox is more accurate in positioning the page-fragments using %. IE has some overlap and shrinks to fit the page fragment content . Experiment with pixels (ex. height=500px instead of 100% for left navigation page fragment) to get better results uniformly on all browsers.

Posted at 10:16AM Dec 13, 2005 | Permanent link to this entry
What kind of panel do you mean as the LayoutPanel (Grid Panel or Group Panel)? I've problems with both of them to set the StyleClass. I put the Group Panel on the Page Fragment and try to set the StyleClass.
Is't possible to set various background css styles such as;
background-color: #052756;
background-image: url(resources/robes_vision.jpg);
background-repeat: no-repeat;
background-position: top right;
I want to get an image at the top-right site even when the browser window size is changing.
Maybe you can help me,
Thanks,
Rob
Posted by Rob on January 21, 2006 at 05:22 AM PST #
Posted by Winston Prakash on January 26, 2006 at 06:30 PM PST #
Posted by xiaoyan on July 14, 2006 at 07:51 AM PDT #
Posted by Winston Prakash on July 14, 2006 at 09:49 AM PDT #
Posted by Annet Vermeer on December 11, 2006 at 10:18 AM PST #
Posted by Winston Prakash on December 11, 2006 at 08:45 PM PST #
Posted by Annet Vermeer on December 12, 2006 at 07:09 AM PST #
Posted by Jeff Daily on March 28, 2007 at 01:25 PM PDT #
Posted by Jeff Daily on March 28, 2007 at 02:07 PM PDT #
Posted by 202.83.32.92 on May 08, 2007 at 02:27 AM PDT #
Posted by 202.83.32.92 on May 08, 2007 at 02:28 AM PDT #
Posted by Runa on June 21, 2007 at 03:07 AM PDT #
How can we include the output of other page in middle layout panel now? can you please tell me the procedure to do it?
Posted by Ijaz on October 18, 2007 at 06:15 AM PDT #
Hi Ijaz, what you are asking may be about the Page Fragments - http://www.netbeans.org/kb/55/vwp-pagefragments.html
Posted by Winston Prakash on October 18, 2007 at 07:01 AM PDT #
What would be the procedure if we want to include a fragment at runtime in the Middle Layout Panel? or What would be the procedure if we want to include a fragment at runtime in a page?
Posted by Ijaz on October 19, 2007 at 02:46 AM PDT #
Page Fragment is an include in the page. It gets included at runtime. One Page fragment can appear in multiple pages. If you change the Page fragment, all pages reflect the changes.
Posted by Winston Prakash on October 19, 2007 at 07:34 AM PDT #
My Ajax AutoComplete Component is not working properly (Sugesstion List is displaying some where beneath in the form) with Tabsets and LayoutPanels even after doing lot much exercise from google. Kindly let me know if there is any solution.
Posted by Pardhu on November 14, 2007 at 05:12 AM PST #
Hi Parkash I want ask you that how to add images in image hyperlinks. I generate 5 image hyperlinks using for loop as follows:
ImageHyperlink navigationLink = new ImageHyperlink();
for(int i=0; i<5; i++){
navigationLink = new ImageHyperlink();
navigationLink.setImageUrl(/resources/images/abc.jpg);
}
But I got the following runtime error : duplicate component Id _image.
But when I run the for loop only once then the image is set on the image hyperlink and there in no problem. Please would you help me that how to set the image on image hyperlink in FOR LOOP for more than one times
Posted by Muhammad Ijaz on January 11, 2008 at 03:45 AM PST #
http://www.batteryfast.co.uk/gateway/bat0016.htm gateway bat0016 battery,
http://www.batteryfast.co.uk/gateway/m1200.htm gateway m1200 battery,
http://www.batteryfast.co.uk/gateway/m1300.htm gateway m1300 battery,
Posted by laptop battery on October 24, 2008 at 12:08 AM PDT #
hfhjhkj
Posted by 117.195.193.63 on June 15, 2009 at 05:43 AM PDT #