Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Order Message Board
Hi, Is there a way i can order the message board by displaying last created category as first?
is there any configuration available or is it possible by jsp override?
is there any configuration available or is it possible by jsp override?
Vikash Chandrol, modified 5 Years ago.
RE: Order Message Board
(Answer)
Junior Member
Posts: 30
Join Date: 4/18/13
Recent Posts
Hi Arun,
Please create the fragment project of the message board portlet(web version) and override view_entries.jsp(from message_boards_admin folder).
there you can find below a line of code.
SearchContainer entriesSearchContainer = (SearchContainer)request.getAttribute("view.jsp-entriesSearchContainer");
using searchcontainer object you can get list of results(by using getResults() ) .
so you can easily apply your logic to set specific order( using comprator or comprable java api)
Sample Logic
List<Object> customResults=entriesSearchContainer.getResults();
//you can add custom order logic here over the customResults object.
entriesSearchContainer.setResults(customResults); // assign back to search container.
Happy Coding
Please create the fragment project of the message board portlet(web version) and override view_entries.jsp(from message_boards_admin folder).
there you can find below a line of code.
SearchContainer entriesSearchContainer = (SearchContainer)request.getAttribute("view.jsp-entriesSearchContainer");
using searchcontainer object you can get list of results(by using getResults() ) .
so you can easily apply your logic to set specific order( using comprator or comprable java api)
Sample Logic
List<Object> customResults=entriesSearchContainer.getResults();
//you can add custom order logic here over the customResults object.
entriesSearchContainer.setResults(customResults); // assign back to search container.
Happy Coding

Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™