I have a wrapper class inside of a map that I want to display on a VFP. The output value of the map is:
{2017-07-13 16:28:02=CaseInfo:[caseNumber=00033490, taskData=Task:{WhatId=500S0000008l5A3IAI, Id=00TS000000Ul9poMAB, CreatedDate=2017-07-13 16:28:02, Comments__c=Olivia Test Case Portfolio Record Type SENT, OwnerId=00534000009QnEtAAK, Subject=Email: Olivia Test Case Portfolio Record Type SENT, AccountId=001S000000raQdyIAE, CreatedById=00534000009QnEtAAK, RecordTypeId=01280000000BawwAAC}],
2017-07-13 16:28:30=CaseInfo:[caseNumber=00033490, taskData=Task:{WhatId=500S0000008l5A3IAI, Id=00TS000000Ul9puMAB, CreatedDate=2017-07-13 16:28:30, Comments__c=RESPONSE, OwnerId=00580000003HZZnAAO, Subject=RE: Sandbox: Olivia Test Case Portfolio Record Type RESPONSE, CreatedById=00580000003HZZnAAO, RecordTypeId=01280000000BawwAAC}],
2017-07-17 18:57:22=CaseInfo:[caseNumber=00033494, taskData=Task:{WhatId=500S0000008lPkSIAU, Id=00TS000000UlRjlMAF, CreatedDate=2017-07-17 18:57:22, Comments__c=TEST COMMENTS From: Olivia Porter, OwnerId=00534000009ceS2AAI, Subject=RE: Sandbox: Wire In -, CreatedById=00534000009ceS2AAI}]}`
I want to pull out the key, the caseNumber, and the Task Subject. I am able to pull out the key and the caseNumber but unable to delve further into the map. How would I go about doing something like this?
<apex:repeat value="{!caseTaskMap}" var="taskTime">
<th colspan="5" id="casenumber">{!taskTime}</th> <!--displays the key-->
<apex:repeat value="{!caseTaskMap[taskTime]}" var="caseInfo"> <!--displays the whole CaseInfo value-->
<apex:repeat value="{!caseTaskMap[taskTime[caseInfo]]}" var="taskData"><!--does not work-->
<apex:repeat value="{!caseTaskMap[taskTime[caseInfo[taskData]]]}" var="task"><!--does not work-->
<tr>
<td>{!taskData.CaseNumber}</td>
<td>{!task.Subject}</td>
</tr>
</apex:repeat>
</apex:repeat>
</apex:repeat>
</apex:repeat>
For ease of viewing, I hope the returned value is enough to understand the question. If not, I can add the wrapper class and map in.
UPDATE: Wrapper
class CaseInfo {
public String caseNumber {get;set;}
public Task taskData {get;set;}
CaseInfo(String caseNumber, Task taskData) {
this.caseNumber = caseNumber;
this.taskData = taskData;
}
}
public viewAllCaseCommentsActivitiesController() {
....
orderedTaskList1 = [SELECT (SELECT CreatedDate, Comments__c, OwnerId, Subject, Owner.Name, AccountId, WhatId, CreatedById, Account.Name FROM Tasks WHERE Private__c = FALSE AND (Status = 'Completed' OR Status = 'Closed')
ORDER BY CreatedDate DESC), AccountId, CaseNumber, Merchant_Number__c FROM Case WHERE AccountId = :strAccountId AND Id IN :accountIds];
caseTaskMap = new Map<String, CaseInfo>();
for(Case c : orderedTaskList1){
for (Task t : c.Tasks) {
caseTaskMap.put(''+t.CreatedDate, new CaseInfo(c.CaseNumber,t));
}
}
}