One Table, Two Fields with orderable columns Example

 

 

         For our client "goodclient" we are doing a portlet project called "xmlpfexampleE" where we want to create a users table maintenance, where there are two fields one is the "userName" and the other is the "userCity". We want to be able to order the columns up and down. 

 

         This is how the portlet will look in the page with Liferays Classic theme. Observe that always column Id is ordered by default, also observe that columns Name and City, now are "clickable".

  

        This is how the portlet will look after a click on the "Name" link. Observe that now the column Name is ordered ASC

 

Same result but order DESC, if name is clicked again.

 

          Here you have the full XMLPortletFactory xml file.

XMLPFExample05.xml

          And here you have the portlet war generated. (for liferay 6.0.6)

xmlpfexampleE-portlet-6.0.6.1.war

          If you want to use this example you can follow instructions here DOCUMENTATION