gpt4 book ai didi

css - 固定按钮在 JSF 页面对话框中的位置

转载 作者:行者123 更新时间:2023-11-28 14:15:30 24 4
gpt4 key购买 nike

我正在使用 PrimeFaces 对话框。我那里只有几个元素。一个数据表和 2 个按钮(确定和取消)。但是按钮显示在底部,只有当我向下滚动整个表格时才可见。我希望它们始终显示在底部,无论我是在第一行还是最后一行。我搜索了很多但没有找到任何有用的东西。这是我的代码片段:

<f:facet name="{SelectPrijemca}">
<div class="Fs14 Absolute" style="right: 11px; top: 4px">
<p:outputLabel value="#{MAService.selectedPrijemca.nazO}" style="color:white"/>
<p:spacer width="7px"/>
<p:commandButton value="Príjemca" id="selectPrijemcaButton" icon="fa fa-user" rendered="#{MAService.managerAccess}"
onclick="PF('PrijemcaDialogWidget').show();" style="margin-top:2px">
</p:commandButton>
</div>
<p:dialog id="PrijemcaDialog" header="Vybrať príjemcu" widgetVar="PrijemcaDialogWidget" showEffect="fade" hideEffect="fade" height="600" width="1300" position="center" modal="false" resizable="false" >
<h:form id="prijemcaForm">
<p:dataTable
id="prijemcaTable"
scrollable="false"
var="prijemca"
widgetVar="prijemcaTableWidget"
value="#{MAService.prijemcoviaList}"
selectionMode="single"
filteredValue="#{MAService.filteredPrijemcovia}"
emptyMessage="#{messages.localizeEShop('webclient$datatable.tableEmpty')}"
selection="#{MAService.selectedPrijemca}"
rowKey="#{prijemca.id}" >

<p:column width="50"
filterBy="#{prijemca.nazO}" filterMatchMode="contains"
filterStyleClass="narrowEdit"
headerText="#{messages.localizeEShop('webclient$subfiles.lo.LOObjWeb.cols.PrijNaz')}"
sortBy="#{prijemca.nazO}" styleClass="TexAlLeft"
style="white-space: nowrap !important;>
<h:outputText value="#{prijemca.nazO}" styleClass="TexAlLeft" style="color: gray"/>
</p:column>
<p:column width="5"
filterBy="#{prijemca.ici}" filterMatchMode="contains"
filterStyleClass="narrowEdit"
headerText="#{messages.localizeEShop('webclient$subfiles.lo.LOObjWeb.cols.PrijIci')}"
sortBy="#{prijemca.ici}" styleClass="TexAlLeft"
style="white-space: nowrap !important;>
<h:outputText value="#{prijemca.ici}" styleClass="TexAlLeft" style="color: gray"/>
</p:column>
</p:dataTable>
<p:panelGrid columns="2">
<p:commandButton value="OK" icon="fa fa-check" process="prijemcaForm" actionListener="#{MAService.changePrijemca()}" update="contentForm"/>
<p:commandButton value="Zrušiť" icon="fa fa-times" onclick="PF('PrijemcaDialogWidget').hide()" style="background-color:red"/>
</p:panelGrid>
</h:form>
</p:dialog>

</f:facet>

请注意,我无法使 dataTable 可滚动,因为我在另一个 dataTable 的 paginatorTemplate 中使用了这个方面,它以某种方式使该表所在的所有页面都可滚动。

当我将 panelGrid 包装在按钮所在的位置时,我找到了一个部分解决方案:

<div style="position: fixed; width: 65%; top: 70%; left: 16%></div>     

但这并不能修复对话框中的按钮,而是修复整个页面上的按钮。因此,当有办法使对话框不可移动(可拖动)时,我可以采用这种方式。

最佳答案

尝试将您的数据表放入 outputPanel 并设置样式

<p:outputPanel id="opScrl" style="height:560px;overflow:auto">
<p:dataTable ...>
</p:dataTable>
</p:outputPanel>

关于css - 固定按钮在 JSF 页面对话框中的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55967687/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com