sorting in p:dataTable

UI Components for JSF
Post Reply
KingdomHeart
Posts: 280
Joined: 25 Jun 2010, 01:18

17 Aug 2010, 21:13

I look at the showcase of how to do sorting in dataTable, http://www.primefaces.org/showcase/ui/d ... Client.jsf, I did not see any attribute is set that make it do sorting. I look at the bean, nothing interesting beside sometimes "cars" is refer as "carsSmall". How do we do sorting in dataTable again?

Mojarra 2.1.10, Glassfish 3.1, Tomcat 7, Primeface 3.3.1
IE 6-8, FireFox 10-13
MAC OSX Lion, Windows XP, 7

callahan
Posts: 768
Joined: 27 May 2010, 22:52

17 Aug 2010, 21:35

Hi,

Hmm, the source code in the showcase doesn't appear to be telling the full story! For example, the first column of the first dataTable should look like this:

Code: Select all

<p:column sortBy="#{car.model}">
	<f:facet name="header">
		<h:outputText value="Model" />
	</f:facet>
	<h:outputText value="#{car.model}" />
</p:column>
The important bit is the sortBy attribute. There's more info on page 112 of the current user's guide.

KingdomHeart
Posts: 280
Joined: 25 Jun 2010, 01:18

17 Aug 2010, 21:55

super. Thank you

Mojarra 2.1.10, Glassfish 3.1, Tomcat 7, Primeface 3.3.1
IE 6-8, FireFox 10-13
MAC OSX Lion, Windows XP, 7

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 78 guests