You need to sign in to do that
Don't have an account?
Chitra Thambirajan
How to add sorting for aggregate results in page block table
I have a page block table and added column values specifically instead of referring the whole object as a list. The requirement is I need to add sorting for all the columns. I have followed this blog page (http://gaganbansalblog4u.com/2013/02/28/pagination-in-visualforce-page-along-with-sorting/" target="_blank)
and added sorting for the columns which I have simply queried from object.
the problem here is,in my pageblock table I have 2 aggregate result fields/coulmns and I need to add sorting functionality to those columns as well.
Assigning values for all the fields for the first time, In the standard controller constructor retrieving the query result in a list and assigning the list to the standard controller as mentioned in the blog.
In the constructor part itself created 2 Map variables and assigned the aggregate query result value to that particular field.
When I go for sorting, For simple sorting(non aggregate result fields) am simply querying the object with asc/desc and assigning the list to the standard controller constructor.
But am unable to use the same procedure for this aggregate result value..
I tried all the ways..Nothing is working for me..
Have anyone faced this kind of scenarios.. Any idea.. I hope am not confusing..If you need any more info I can provide... Thanks in advance..
and added sorting for the columns which I have simply queried from object.
the problem here is,in my pageblock table I have 2 aggregate result fields/coulmns and I need to add sorting functionality to those columns as well.
Assigning values for all the fields for the first time, In the standard controller constructor retrieving the query result in a list and assigning the list to the standard controller as mentioned in the blog.
In the constructor part itself created 2 Map variables and assigned the aggregate query result value to that particular field.
When I go for sorting, For simple sorting(non aggregate result fields) am simply querying the object with asc/desc and assigning the list to the standard controller constructor.
But am unable to use the same procedure for this aggregate result value..
I tried all the ways..Nothing is working for me..
Have anyone faced this kind of scenarios.. Any idea.. I hope am not confusing..If you need any more info I can provide... Thanks in advance..
For Better pageblocktable sorting use the below one and this will allow every column will be sortable.
http://blogforce9.blogspot.in/2013/02/enhanced-pableblock-table-for.html
For code use this unmanged package --> https://ap1.salesforce.com/packaging/installPackage.apexp?p0=04t90000000MIJ3
This will simple and easy....!
Thank you so much for your response..The link which you have given is not working for me..
Might be I have given wrong values to these paramaters - sObjList="{!accounts}" fieldList="{!fields}"
But from your suggestion I have come to know about the EnahancedPageBlockTable...
So I have searched for Enhanced Page block table and got the following
http://blogforce9dev-developer-edition.ap1.force.com/ProjectDetail?id=a0290000007rdwd (http://blogforce9dev-developer-edition.ap1.force.com/ProjectDetail?id=a0290000007rdwd" target="_blank)
and it is working fine for all the columns except for boolean values.
I am retrieving booloen value for a column,if it is true in the page(table column) one checked check box is getting display if it is false it showing as empty box..
If I click on this column header it is not working as expected..It is simply refreshing the page..Not sorting the records..
Any advice please...
Thanks
Chitra