Hi Guys,
I'm playing with DataTable - ColumnToggler and DataTable - Filter. I combined both elements in one table. If I deselect a column and do a global filter then p.databale drwas the deselected columns again but without a header. I think there's a little bit more work to do
DataTable - ColumnToggler and DataTable - Filter
Hi Guys,
facing the same issue here. Any updates so far ? I'm using Primefaces 5.2.
The issue is when i load the list i have per default some columns not visible (i can make them visible using the columnToggler which works fine).
When i make a column visible through the columnToggler und search the records via the globalFilter and remove my search then the header will be displayed correctly but the columns goes missing. I end up with 7 header columns with 6 content columns (it shifts the content columns to the left).
Any suggestions ?
Following my code:
facing the same issue here. Any updates so far ? I'm using Primefaces 5.2.
The issue is when i load the list i have per default some columns not visible (i can make them visible using the columnToggler which works fine).
When i make a column visible through the columnToggler und search the records via the globalFilter and remove my search then the header will be displayed correctly but the columns goes missing. I end up with 7 header columns with 6 content columns (it shifts the content columns to the left).
Any suggestions ?
Following my code:
Code: Select all
<p:dataTable id="users" widgetVar="usersTable" var="user" value="#{userBean.lazyUsers}" scrollable="false" frozenColumns="0" sortMode="multiple" stickyHeader="false" draggableColumns="false" draggableRows="false" rows="50" paginator="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" paginatorPosition="bottom" rowsPerPageTemplate="10, 25, 50, 75, 100" tableStyle="width:auto" lazy="true" resizableColumns="true">
<f:facet name="header">#{LocaleBean.getNavigationMenuLocales("User")}<h:panelGroup layout="block" style="float:right">
<p:outputPanel>
<p:inputText id="globalFilter" onkeyup="PF('usersTable').filter()" placeholder="Filter"/>
<p:commandButton id="toggler" type="button" value="Columns" icon="ui-icon-calculator"/>
<p:columnToggler datasource="users" trigger="toggler">
<p:ajax event="toggle" listener="#{userBean.onToggletestUserList}"/>
</p:columnToggler>
</p:outputPanel>
</h:panelGroup>
<br/>
<br/>
</f:facet>
<p:column colspan="0" exportable="true" filterMatchMode="startsWith" filterable="true" headerText="" priority="0" rendered="true" resizable="true" rowspan="0" selectRow="true" sortable="true" toggleable="true" visible="true">
<p:link outcome="/user/userCreate" value="#">
<f:param name="userId" value="#{user.id}"/>
</p:link>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.active}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_active")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="false" sortBy="#{user.active}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[0]}">
<p:selectBooleanCheckbox disabled="true" immediate="false" rendered="true" required="false" value="#{user.active}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.title}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_title")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="true" sortBy="#{user.title}" sortable="false" toggleable="true" visible="#{userBean.toggleListtestUserList[1]}">
<h:outputText rendered="true" value="#{user.title}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.lastName}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_lastName")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="true" sortBy="#{user.lastName}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[2]}">
<h:outputText rendered="true" value="#{user.lastName}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.firstName}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_firstName")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="true" sortBy="#{user.firstName}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[3]}">
<h:outputText rendered="true" value="#{user.firstName}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.username}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_username")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="true" sortBy="#{user.username}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[4]}">
<h:outputText rendered="true" value="#{user.username}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="" filterMatchMode="startsWith" filterStyle="" filterable="false" headerText="#{LocaleBean.getNavigationMenuLocales("User_vip")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="false" sortBy="#{user.vip}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[5]}">
<p:selectBooleanCheckbox disabled="true" immediate="false" rendered="true" required="false" value="#{user.vip}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="" filterMatchMode="startsWith" filterStyle="" filterable="false" headerText="#{LocaleBean.getNavigationMenuLocales("User_jobTitle")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="false" sortBy="#{user.jobTitle}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[6]}">
<h:outputText rendered="true" value="#{user.jobTitle}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.timezone}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_timezone")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="true" sortBy="#{user.timezone}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[7]}">
<h:outputText rendered="true" value="#{user.timezone}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.lastModified}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_lastModified")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="false" sortBy="#{user.lastModified}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[8]}">
<h:outputText rendered="true" value="#{user.lastModified}">
<f:convertDateTime dateStyle="default" locale="#{localeBean.locale}" timeZone="#{localeBean.timezone}" type="both"/>
</h:outputText>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.employeeID}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_employeeID")}" priority="0" rendered="true" resizable="true" rowspan="0" selectRow="false" sortBy="#{user.employeeID}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[9]}">
<h:outputText rendered="true" value="#{user.employeeID}"/>
</p:column>
<p:column colspan="0" exportable="true" filterBy="#{user.createdOn}" filterMatchMode="startsWith" filterStyle="display:none; visibility:hidden;" filterable="true" headerText="#{LocaleBean.getNavigationMenuLocales("User_createdOn")}" priority="0" rendered="true" resizable="false" rowspan="0" selectRow="false" sortBy="#{user.createdOn}" sortable="true" toggleable="true" visible="#{userBean.toggleListtestUserList[10]}">
<h:outputText rendered="true" value="#{user.createdOn}">
<f:convertDateTime dateStyle="default" locale="#{localeBean.locale}" timeZone="#{localeBean.timezone}" type="both"/>
</h:outputText>
</p:column>
<f:facet name="{Exporters}">
<h:commandLink>
<p:graphicImage name="/images/pdf.png" width="24"/>
<p:dataExporter type="pdf" target="users" fileName="users"/>
</h:commandLink>
<h:commandLink>
<p:graphicImage name="/images/xml.png" width="24"/>
<p:dataExporter type="xml" target="users" fileName="users"/>
</h:commandLink>
</f:facet>
</p:dataTable>
-
- Posts: 4
- Joined: 19 Jun 2013, 14:14
- Location: Germany
Has anybody found a solution to this behaviour?
Primefaces 3.5.8
GlassFish Server Open Source Edition 3.1.2.2 (build 5)
JSF 2.0 API
GlassFish Server Open Source Edition 3.1.2.2 (build 5)
JSF 2.0 API
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests