I have this code in My JSF Page
<h:dataTable value="#{announcementBean.monthList}" var="myMapEntry">
<h:column>
<h:outputText value="#{myMapEntry.key}" />
<h:dataTable value="#{myMapEntry.value}" var="family">
<h:column>
<h:outputText value="#{family.monthName}" />
</h:column>
</h:dataTable>
</h:column>
</h:dataTable>
And my data is something like this
{2007=[com.kuber.vo.AnnouncementVO@87281f], 2010=[com.kuber.vo.AnnouncementVO@15b4804, com.kuber.vo.AnnouncementVO@1d510be], 2012=[com.kuber.vo.AnnouncementVO@13e49a8]}
But the generated HTML page displays nothing. What can be issue in this code?
private TreeMap<String, List<AnnouncementVO>> monthList = new TreeMap<String, List<AnnouncementVO>>();
public void fetchMonthList(List<AnnouncementVO> dataList) {
for (AnnouncementVO announcementVO : dataList) {
String year = getYearFromDate(announcementVO.getAnnouncementDt());
if (!monthList.containsKey(year)) {
ArrayList listRecord = new ArrayList();
announcementVO.setMonthName(getMonthANDYearFromDate(announcementVO.getAnnouncementDt()));
listRecord.add(announcementVO);
monthList.put(year, listRecord);
} else {
ArrayList list = (ArrayList) monthList.get(year);
announcementVO.setMonthName(getMonthANDYearFromDate(announcementVO.getAnnouncementDt()));
list.add(announcementVO);
monthList.put(year, list);
}
}
}