【问题标题】:Positioning the OverlayPanel of PrimeFaces定位 PrimeFaces 的 OverlayPanel
【发布时间】:2012-07-03 15:19:57
【问题描述】:

你能给我修复overlayPanel 位置的键/值吗?我想在中间修复它,但我无法弄清楚。我有这个例子:

<p:overlayPanel id="overlayPanelSearch" for="searchButton" my="top" at="bottom">

【问题讨论】:

    标签: primefaces position overlay panel


    【解决方案1】:

    要将它移到中间,只需使用middle

    即使documentation 只是提到right, left, top, middle,您也可以在 x 轴和 y 轴上另外使用 middle

    例子:

    <p:overlayPanel id="overlay" my="center top" at="right center">  
    

    此功能可能会因为此请求而在稍后添加: https://forum.primefaces.org/viewtopic.php?t=45084

    【讨论】:

      【解决方案2】:

      我认为描述如何使用它的文档是错误的。 它被描述为使用“左上角”之类的东西。

      尝试使用 my="left top" at="left bottom" 并且 效果很好!

      希望这可以帮助你..

      【讨论】:

        【解决方案3】:

        我是这样理解的。
        “我的”是覆盖面板框。
        “at”是命令按钮。

        <p:commandButton id="chartBtn" type="button" />  
        <p:overlayPanel id="chartPanel" for="chartBtn" my="right top" at="right bottom">  
          ...
        </p:overlayPanel>  
        

        所以上面写着:“将覆盖面板的右上方与命令按钮的右下方连接起来”

        【讨论】:

        • 你最后一句话解释得很好。
        【解决方案4】:

        使用overlayPanel的以下属性:

        for - Identifier of the target component to show the panel
        my  - Position of the panel relative to the target (ex: my="left top")
        at  - Position of the target relative to the panel (ex: at="left bottom")
        

        【讨论】:

        • 这对我不起作用:
        • @user1667910,发新帖
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-05-29
        • 2014-06-24
        • 1970-01-01
        • 2013-03-17
        • 2012-08-07
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多