You need to sign in to do that
Don't have an account?
Mohan Raj 33
How to solve this problem in apex controller class?
Hi, to all I am new in the extension controller here I try implement the function on the sorting to my visual force page but the sorting and pagination is not working together here(I already done the pagination only using the standard controller). So I check the developer console on my apex class it's provide the error on followingly in the image
So I don't know how to clear this error so please help me to done this task.and my apex class is followingly,
For answer's thanks in advance.Thanks Mohan.
So I don't know how to clear this error so please help me to done this task.and my apex class is followingly,
public class AccountListViewController{ public List<Account> AccountsortList {get; set;} public String SortingExpression = 'name'; public String DirectionOfSort = 'ASC'; public Integer NoOfRecords {get; set;} public Integer Size{get; set;} public AccountListViewController(ApexPages.StandardSetController controller) { AccountsortList = new List<Account>(); ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(AccountsortList); } /*public Integer pageNumber { get { return ssc.getpageNumber(); } set; }*/ public String ExpressionSort { get { return SortingExpression; } set { If(value == SortingExpression) { DirectionOfSort = (DirectionOfSort == 'ASC')? 'DESC' : 'ASC'; } else { DirectionOfSort = 'ASC'; SortingExpression = value; } } } public String getDirectionOfSort() { If(SortingExpression == Null || SortingExpression == '') { return 'DESC'; } else { return DirectionOfSort; } } public void setDirectionOfSort(String value) { DirectionOfSort = value; } public List<Account>getAccounts() { return AccountsortList; } public PageReference ViewData() { String FullSortExpression = SortingExpression + ' ' + DirectionOfSort; system.debug('SortingExpression:::::'+SortingExpression); system.debug(DirectionOfSort); String Queryitem = ' SELECT Id, Name, Phone, BillingState, Type, Owner.Name, Website FROM Account WHERE Account.Name != Null ORDER BY ' + FullSortExpression +' Limit 10'; system.debug(Queryitem); AccountsortList = DataBase.query(Queryitem); system.debug(AccountsortList); return Null; } }
For answer's thanks in advance.Thanks Mohan.
All Answers
Thank you, Mohan
<apex:outputPanel id="AccountsList">
<apex:pageBlockTable value="{!AccountsortList}" var="t" rendered="{!NOT(ISNULL(AccountsortList))}" id="blocktable">
<apex:commandLink action="{!ViewData}" value="Account Name{!IF(ExpressionSort=='name',IF(DirectionOfSort == 'ASC', '▼', '▲'),'')}" reRender="AccountsList">
<apex:param value="name" name="column" assignTo="{!ExpressionSort}" ></apex:param>
</apex:commandLink>
....
....
</apex:pageBlockTable>
</apex:outputPanel>
let me know how that goes
system.debug(AccountsortList);
Constructor not defined: [AccountListViewController].<Constructor>().