【问题标题】:jsf primefaces dialog does not render completely with layout insidejsf primefaces 对话框没有完全呈现内部布局
【发布时间】:2014-11-15 18:57:35
【问题描述】:

我遇到的问题是,当我想将我的对话框与布局和布局单元分开时,只有北部布局单元的 10 像素上部会被渲染。在渲染的那个小部分中,您可以向下滚动以查看北“12”和中心“12”的值。

    <h:form id="mainDllg">
        <p:dialog id="mainDlg" header="12" widgetVar="mainDlg"
            rendered="true" closeOnEscape="true"
            style="width:99% !important; height:99% !important"
            resizable="false" modal="true">
            <p:outputPanel>

                <p:layout>
                    <p:layoutUnit position="north">12</p:layoutUnit>

                    <p:layoutUnit position="center">12</p:layoutUnit>
                </p:layout>
                
            </p:outputPanel>
        </p:dialog>
    </h:form>

【问题讨论】:

    标签: css jsf jsf-2 primefaces


    【解决方案1】:
    <h:form id="mainDllg">
            <p:dialog id="mainDlg" header="12" widgetVar="mainDlg"
                rendered="true" closeOnEscape="true"
                resizable="false" modal="true">
                <p:outputPanel>
    
                    <p:layout style="min-width:400px;min-height:200px;">
                        <p:layoutUnit position="north" size="30">12</p:layoutUnit>
    
                        <p:layoutUnit position="center">12</p:layoutUnit>
                    </p:layout>
    
                </p:outputPanel>
            </p:dialog>
        </h:form>
    

    你应该试试这个。

    【讨论】:

    • 就是这样 :) 我使用图形环境 java lib 实现了客户端屏幕大小,但是在部署时遇到了问题。有没有办法直接在样式属性中使用 JavaScript(可能是 min-width: screen.width px)?
    猜你喜欢
    • 2011-07-26
    • 2013-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-08
    • 1970-01-01
    • 2012-12-28
    • 1970-01-01
    相关资源
    最近更新 更多