primefaces datatable 怎么让footer固定

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了primefaces datatable 怎么让footer固定相关的知识,希望对你有一定的参考价值。

参考技术A 1. 不同的选项会显示在你的数据表的页脚方面的空白员工,并将其添加到列表中,如果点击添加按钮。有了这个,你可以确保只有正确填写employee对象/实体被添加到列表中。
2. 要么你单击Add按钮时打开一个对话框或弹出。然后填写所需的字段(附加到一个Employee对象,而在保存时/提交您的对象添加到您的Employee对象列表,而重新呈现的数据表。 或者你可以空emploee对象最初添加到列表中。显示它与inputfields的数据表。添加你的新员工添加到列表中,并重新呈现列表。
3. list_Recs是记录列表 CodeGo.net,并在数据表中示出。<p:dataTable id="myTable" value="#myBean.list_Recs" selectionMode="single" var="myTableVar" selection="#myBean.currentRec">
<p:ajax event="rowSelect" listener="#myBean.handleRowSelect" update=":myForm:myPanel"/>
<p:column>
<f:facet name="header">
<h:outputLabel value="Field 1" />
</f:facet>
<h:outputLabel value="#myTableVar.Field1"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel value="Field 2" />
</f:facet>
<h:outputLabel value="#myTableVar.Field2" />
</p:column>
<f:facet name="footer">
<p:commandButton value="New" action="#myBean.prepareForInsert" update=":myForm:myPanel"/>
</f:facet>
</p:dataTable>
<h:panelGrid id="myPanel" columns="2" >
<h:outputLabel value="Field 1"/>
<p:inputText id="fld1" value="#myBean.newRec.field1" />
<h:outputLabel value="Field 2"/>
<p:inputText id="fld2" value="#myBean.newRec.field2" />
<p:commandButton action="#myBean.createAction" value="Submit" update="myGrowl myTable" />
</h:panelGrid>

当单击New按钮,在一个myBean的prepareForInsert例行创建newRec的emty实例。使myPanel填充在字段空白。在提交时,newRec添加到 list_Recs和新记录被diplayed在MyTable的更新的数据表。 希望这会有所帮助。

以上是关于primefaces datatable 怎么让footer固定的主要内容,如果未能解决你的问题,请参考以下文章

为 Datatable primefaces 设置列宽

将 primefaces 数据表与 org.primefaces.component.datatable.DataTable 绑定;

Primefaces:从p:dataTable中的行选择中排除列

Primefaces dataTable过滤日期

使用带有Primefaces DynaForms的dataTable

如何在 PrimeFaces 3.0 的 p:dataTable 中设置 p:column 的宽度?