开发者

newbie JSF question - How to achieve this layout?

开发者 https://www.devze.com 2022-12-18 15:00 出处:网络
I\'m try开发者_JAVA技巧ing to achieve the layout shown here Each of the panels should be linked to a backing bean from which I will later add differrent components according to context.

I'm try开发者_JAVA技巧ing to achieve the layout shown here

newbie JSF question - How to achieve this layout?

Each of the panels should be linked to a backing bean from which I will later add differrent components according to context.

I tried using panelgrid but could not achieve this look. I would prefer to use just JSF for this but if impossible or too complicated RichFaces is ok too.

Thanks!!


It's not only matter of JSF/HTML, but it's also a matter of CSS. The above layout can basically already be achieved as follows:

<h:panelGroup id="header" layout="block"></h:panelGroup>
<h:panelGroup id="leftcol" layout="block"></h:panelGroup>
<h:panelGroup id="rightcol" layout="block"></h:panelGroup>

(which generates the following HTML)

<div id="header"></div>
<div id="leftcol"></div>
<div id="rightcol"></div>   

You can style/position it using CSS like as:

#header {
    width: 100%;
    height: 100px;
}
#leftcol {
    width: 200px;
    float: left;
}
#rightcol {
    float: left;
}

That's all.


You can use the HTML code with which you have achieved the above layout. I.e.

<table>
   <tr>..</tr>
   <tr>..</tr>
</table>

However, the table-less layouts are preferred - i.e. using <div> tags. (see here)

0

精彩评论

暂无评论...
验证码 换一张
取 消