You need to sign in to do that
Don't have an account?

How to display in order
hi,
I am using wrapper class to display the date in vf but here it works fine but i need to display in ascending order
can any one please help
here is my code sample
Public lass finalpay() { public void prepareMap() { salesPerformanceData = new Map<Date, FRSummaryWrap>(); List<Time_Card__c> empList = [select name,day__c,date__c,days__c from Time_Card__c where Month__c=:month and Employee__r.name=:emp and Year__c=:year order by date__c ASC]; for(Time_Card__c emp: empList){ salesPerformanceData.put(emp.Date__c,new FRSummaryWrap(emp.Date__c,amount)); } } public List<FRSummaryWrap> getWrapSummaryList(){ return salesPerformanceData.values(); } public class FRSummaryWrap{ public Date tdate{get;set;} public FRSummaryWrap(Date dat,String prunitamt){ tdate = dat; } } }
Here is my VF page
<apex:repeat value="{!wrapSummaryList}" var="Wrp"> <tr border="1"> <td Style="font-family: Arial; font-size: 10pt; font-weight: bold;">{!Wrp.tdate}</td> </tr> </apex:repeat>
Hi,
The wrapper class which you are using, Please create some properties for the following fields
Total_Time_TI__c
Then populate this properties by applying the conditions which you are currently doing in totaltime() method. Then finally you will have a wrapper class with all fields values. Use that class on page.
Please let me know if there is any issue.
Thanks,
Devendra Natani
All Answers
Hi,
You are put the data in map using "empList". Map is a un-ordered collection. It will not return the data in same order in which you are putting into that.
Instead of using map please try something like that.
Please let me know if there is any issue.
Thanks,
Devendra Natani
Blog
Hi
Thanks for your suggestion, i am using map here becouse depending on the date im calculating some value please go through the below code once
Thanks
You can keep both map and list. The values which you are updating into map depending on some conditions. You can update the list accordingly as well. The method "getWrapSummaryList()" should return a list and the list should not be driven from a map.
i.e. map.values()
Please let me know if there is any issue.
Thanks,
Devendra Natani
hi,
When im going to return the list it will daiplaying date with order, but my calculation part will not come
can u tel, how it will solve
Thanks
Hi,
The wrapper class which you are using, Please create some properties for the following fields
Total_Time_TI__c
Then populate this properties by applying the conditions which you are currently doing in totaltime() method. Then finally you will have a wrapper class with all fields values. Use that class on page.
Please let me know if there is any issue.
Thanks,
Devendra Natani
Hi,
when using list it will display the field values for particular date but i need to do some calculation
for ex: totaltime=calculating all total fields
and totalunit=totaltime/60
and it will display with particular date
can you please....
Thanks
Hi,
Thanks a lot its working fine