KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Sorting is not working in datatable in PrimeFaces. Please suggest. See below my .xhtml file <h:form> <p:dataTable style="width: 60%" id="dt1" value="#{bean.list}" var="entry" first="0" paginator="true" rows="10" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" emptyMessage="No cars found with given criteria" > <f:facet name="header"> <h2>Cars View</h2> </f:facet> <p:column sortBy="#{entry.carno}" filterBy="#{entry.carno}"> <f:facet name="header"> <h:outputText value="Car Number" /> </f:facet> <h:outputText value="#{entry.carno}"></h:outputText> </p:column> <p:column sortBy="#{entry.carsettings['car-model']}" filterBy="#{entry.carsettings['car-model']}"> <f:facet name="header"> <h:outputText value="Car Model"/> </f:facet> <h:outputText value="#{entry.carsettings['car-model']}"></h:outputText> </p:column> <p:column sortBy="#{entry.carsettings.year}" filterBy="#{entry.carsettings.year}"> <f:facet name="header"> <h:outputText value="Car Year"/> </f:facet> <h:outputText value="#{entry.carsettings.year}"></h:outputText> </p:column> <p:column sortBy="#{entry.carsettings.color}" filterBy="#{entry.carsettings.color}"> <f:facet name="header"> <h:outputText value="Car Color"/> </f:facet> <h:outputText value="#{entry.carsettings.color}"></h:outputText> </p:column> </p:dataTable> </h:form> @Sean Look below code List of Cars <ui:composition template="/template.xhtml">
Tags (comma-separated)
Save Edits
Cancel