Datatable Column sortFunction not working

UI Components for JSF
Post Reply
haroona
Posts: 3
Joined: 21 Feb 2011, 02:35

24 Mar 2011, 23:05

Hi,

I've this piece of code:

Code: Select all

<p:column  sortFunction="#{csPage.compareByName}" sortBy="#{control.control_name}">
						<f:facet name="header">Control Name</f:facet>
						<h:commandLink action="view-control"
							value="#{control.control_name}" />
</p:column>

Code: Select all

public int compareByName(Object o1, Object o2)
    {        
        ControlEntity goal1 = (ControlEntity) o1;
        ControlEntity goal2 = (ControlEntity) o2;        
        
        return goal1.getControl_name().compareTo(goal2.getControl_name());
    }
But when I click on the header of the column, the sortFunction "compareByName" is never invoked, and the results are not sorted.

Any guesses what I might be doing wrong?

Thanks!

-Haroon

Sammi84
Posts: 1
Joined: 15 Nov 2013, 12:56

15 Nov 2013, 12:58

I'm having the same issue, and I can't seem to find any fix on this forum, Google or StackOverflow. Been searching for almost two hours :(

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests