6

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

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

4 回答 4

12

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

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

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

于 2013-07-17T17:17:19.363 回答
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")
于 2012-07-03T13:07:06.733 回答
2

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

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

希望这可以帮到你..

于 2013-09-17T10:12:05.533 回答
0

要将其移动到中间,只需使用middle.

即使文档只是提到right, left, top, middle您还可以在middlex 轴和 y 轴上使用。

例子:

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

由于此请求,此功能稍后可能已添加: https ://forum.primefaces.org/viewtopic.php?t=45084

于 2019-06-22T14:32:38.380 回答