[SOLVED]Height problem of layout

UI Components for JSF
Post Reply
yyq2009aa
Posts: 61
Joined: 18 Jun 2010, 21:39

15 Apr 2013, 09:48

Hi, I have a layout page like following:

Code: Select all

    <h:body>
        <p:layout fullPage="false">
            <p:layoutUnit position="west" size="260">
                <h:form>
                    <p:panelGrid columns="1">
                        <h:commandButton value="Test1"/>
                        <h:commandButton value="Test2"/>
                        <h:commandButton value="Test3"/>
                        <h:commandButton value="Test4"/>
                    </p:panelGrid>
                </h:form>
            </p:layoutUnit>
            <p:layoutUnit position="center">
                <p:panel header="panel1" style="height:400px;">
                </p:panel>
            </p:layoutUnit>
        </p:layout>
    </h:body>
The layout is element layout without fixed height, and only have west and center part, on the picture, you'll see that the real height of the whole layout is sum of west children's height and center children's height, not the maximum one of the two which I expected.
Image

And I can't set a fixed height on layout, because there is a dynamic content in the center part, I can't know the exactly height of it.

So it is a bug ?

Any help will be appreciated.
Last edited by yyq2009aa on 17 Apr 2013, 08:28, edited 3 times in total.
PF 3.5
JSF 2.1 (Mojarra 2.1.19)
Glassfish 3.1.2
FF 3.6, IE 8, Chrome 25
Windows 7
NetBeans IDE 7.3

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

15 Apr 2013, 11:03

Are you sure it is a combination? Isn't the form in the west layoutunit not just big?

yyq2009aa
Posts: 61
Joined: 18 Jun 2010, 21:39

15 Apr 2013, 11:39

kukeltje wrote:Are you sure it is a combination? Isn't the form in the west layoutunit not just big?

Hi kukeltje,

Thanks for your reply.

Yes, I'm sure it is a combination.

And there is no other css files in the page, and all the code is here, so I'm sure the form in the west layout unit is not so big.
PF 3.5
JSF 2.1 (Mojarra 2.1.19)
Glassfish 3.1.2
FF 3.6, IE 8, Chrome 25
Windows 7
NetBeans IDE 7.3

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

16 Apr 2013, 15:38

1) Element layout needs fix sizes.
2) If you need dynamic sizes, you are wrong with p:layout. This is not a layout component with scrollbars then. Use h:panelGrid for that e.g.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

yyq2009aa
Posts: 61
Joined: 18 Jun 2010, 21:39

16 Apr 2013, 16:11

Oleg wrote:1) Element layout needs fix sizes.
2) If you need dynamic sizes, you are wrong with p:layout. This is not a layout component with scrollbars then. Use h:panelGrid for that e.g.
Hi Oleg,

Thanks for your reply. I see that.

You mean the pf layout is only for the scenario which needs scrollbars, so I should use h:panelGrid and div to finish my layout.


Many thanks.

BTW, how can I mark the post as resovled, so that others can see that.
PF 3.5
JSF 2.1 (Mojarra 2.1.19)
Glassfish 3.1.2
FF 3.6, IE 8, Chrome 25
Windows 7
NetBeans IDE 7.3

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

16 Apr 2013, 19:57

yyq2009aa wrote:BTW, how can I mark the post as resovled, so that others can see that.
Optimus/Cagatay, already stated, some/long time ago, that it is not necessary to mark topics as [SOLVED], but if you want to know how to do it, then go to the first/initial post of this forum topic, and EDIT the topic title and put [SOLVED], like I did on the subject/title of this response of mine. :)
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests