【问题标题】:PrimeFaces: layout fullPage set as"false" is causing footer to dissapearPrimeFaces:布局完整页面设置为“false”导致页脚消失
【发布时间】:2014-02-17 01:51:52
【问题描述】:

也许这是我今天在这里遇到的另一个新手问题,但我找不到解决方案。尝试了一些 CSS 技巧,但没有给出我想要的结果。

我决定将布局 fullPage 属性设置为 false,因为我不想让任何滚动条让我烦恼,当我更改为 false 时,我得到了我想要的结果。

但它导致页脚消失...它不再显示在我的页面中。

有人知道为什么会这样吗?

我的代码没有什么特别之处,但就是这样:

<p:layout fullPage="false">

    <p:layoutUnit position="north" size="170" resizable="false" closable="false" collapsible="false">  
       //Content
    </p:layoutUnit>  

    <p:layoutUnit position="west" size="200" resizable="false" closable="false" collapsible="false">    
       //Content
    </p:layoutUnit>  

    <p:layoutUnit position="center" resizable="false" closable="false" collapsible="false">                 
       //Content             
    </p:layoutUnit>  

    <p:layoutUnit position="south" size="100" resizable="false" closable="false" collapsible="false">
       //Content
    </p:layoutUnit>  

</p:layout> 

提前致谢。

【问题讨论】:

    标签: html css jsf primefaces


    【解决方案1】:

    看起来这是 primeface 中的一个错误,直到它修复尝试

    <p:layoutUnit styleClass="layoutUnitCenter" position="center"  closable="false" >
         <ui:insert name="content" />
         <ui:include src="footer.xhtml" />
    </p:layoutUnit>
    

    基本上,您将页脚包含在中心内容中,无论页脚将在其下方显示的中心内容大小如何。看起来不错

    【讨论】:

      【解决方案2】:

      关于滚动条的第一个问题,您可以通过在布局样式中添加 css 来删除它:

      <style type="text/css">
              .ui-layout-center {                    
                  overflow-x:hidden !important;
                  overflow-y:hidden !important;
              }
      
              .ui-layout-center .ui-layout-unit-content {
                  overflow-x:hidden !important;
                  overflow-y:hidden !important;
              }     
          </style>
      

      至于第二个问题,您是否尝试为您的布局组件添加固定样式?例如:

      <p:layout style="width:400px;height:200px">
      ...
      </p:layout> 
      

      【讨论】:

        猜你喜欢
        • 2014-12-13
        • 1970-01-01
        • 2014-10-09
        • 2015-01-15
        • 1970-01-01
        • 1970-01-01
        • 2023-02-02
        • 1970-01-01
        • 2019-01-17
        相关资源
        最近更新 更多