Showing posts with label liferay search container ui tag. Show all posts
Showing posts with label liferay search container ui tag. Show all posts

Thursday, June 14, 2012

Liferay Search Container : Orderable Columns

In this post we are going to implement the orderable columns for search container.

Following are the steps -

1. Put the following code in your jsp which is used to render the search container.


This If condition is provided to handle the default case. Here defaultColumn and defaultOrder can be replaced with the desired column and order respectively. Here we are sorting the results on the title column.

2.  Here is the TitleComparator.java code -



3.  add the following code to your controller's render method :



4.  Here is the search container part -




Now Title column in the search container will be rendered as clickable and upon clicking will sort the title column data.