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

How to write vf page for this apex class.
Map<String, map<String, Integer>> ratingVsRecordCountMapOfmap = new Map<String, map<String, Integer>>();
List<Task> lstAggResult = [Select Priority, Status From Task Where Priority != Null AND Status != Null];
if(!lstAggResult.isEmpty()) {
for(Task objTest : lstAggResult) {
if(ratingVsRecordCountMapOfmap.containsKey(objTest.Priority)) {
Map<String, Integer> innermap = ratingVsRecordCountMapOfmap.get(objTest.Priority);
//if(!innermap.isEmpty()) {
if(innermap.containsKey(objTest.Status)) {
Integer count = innermap.get(objTest.Status) + 1;
innermap.put(objTest.Status, count);
}
else {
innermap.put(objTest.Status, 1);
}
ratingVsRecordCountMapOfmap.put(objTest.Priority, innermap);
//}
}
else {
Map<String, Integer> innermap = new Map<String, Integer>();
innermap.put(objTest.Status, 1);
ratingVsRecordCountMapOfmap.put(objTest.Priority, innermap);
}
}
}
system.debug('---> ' + ratingVsRecordCountMapOfmap);
List<Task> lstAggResult = [Select Priority, Status From Task Where Priority != Null AND Status != Null];
if(!lstAggResult.isEmpty()) {
for(Task objTest : lstAggResult) {
if(ratingVsRecordCountMapOfmap.containsKey(objTest.Priority)) {
Map<String, Integer> innermap = ratingVsRecordCountMapOfmap.get(objTest.Priority);
//if(!innermap.isEmpty()) {
if(innermap.containsKey(objTest.Status)) {
Integer count = innermap.get(objTest.Status) + 1;
innermap.put(objTest.Status, count);
}
else {
innermap.put(objTest.Status, 1);
}
ratingVsRecordCountMapOfmap.put(objTest.Priority, innermap);
//}
}
else {
Map<String, Integer> innermap = new Map<String, Integer>();
innermap.put(objTest.Status, 1);
ratingVsRecordCountMapOfmap.put(objTest.Priority, innermap);
}
}
}
system.debug('---> ' + ratingVsRecordCountMapOfmap);
Controller
VF page
Thankyou responding the controller is for displaying task status priority and no.of records assosiated with both fields .
not started inprogress
High 5 2
Normal 4 6
like this I want to display. so could you write vfpage code for above apex controller.