Fire action when change month in calendar.
speedygonzales Feb 3, 2012 4:16 AMI am using rich calendar with my own CalendarDataModel object. I have three type of events. Each cell in current month displays an icon if we have that type of event for the day, and it is set in CalendarDataModelItem . But it doesn't work for the previous month/next month . Although when I select a date it is display correctly. Somehow I have to fire the action that checks what kind of the events there are in the current month when I change the month. Any help will be appreciated.
{code:xml}<rich:calendar
value="#{calendarData.currentDate.time}" popup="false"
showApplyButton="false" cellWidth="53px" cellHeight="45px"
boundaryDatesMode="scroll" showWeeksBar="false"
style="font-style:italic;" dataModel="#{calendarData}"
id="organizer" showFooter="false" showHeader="true" mode="ajax">
<!-- -->
<f:facet name="header">
<h:panelGrid columns="3" width="100%">
<h:outputText value="{previousMonthControl}"
style="text-align:left">
<a4j:support action="#{calendarData.actionCreateTable}"
ajaxSingle="true" event="onclick" oncomplete="document.forms[0].submit();"/>
</h:outputText>
<h:outputText value="{currentMonthControl}"
style="text-align:center" />
<h:outputText value="{nextMonthControl}" style="text-align:right">
<a4j:support action="#{calendarData.actionCreateTable}"
ajaxSingle="true" event="onsubmit" />
</h:outputText>
</h:panelGrid>
</f:facet>
<a4j:outputPanel layout="block" id="cell">
<div>
<h:outputText value="{day}" style="align:center; font-size:14px;" />
</div>
<div> </div>
<div>
<h:outputText value="{hasKom}" escape="false" />
<rich:spacer width="1" />
<h:outputText value="{hasProg}" escape="false" />
<rich:spacer width="1" />
<h:outputText value="{hasNews}" escape="false" />
</div>
</a4j:outputPanel>
<a4j:support event="onchanged"
oncomplete="document.forms[0].submit();"
action="#{calendarData.actionCreateTable}" ajaxSingle="true"
reRender="Calendarform_" />
<a4j:support event="onsubmit"
reRender="organizer,news,meeting,prime,rest,dataTable_news,dataTable_news_all,dataTable_prog_all,dataTable_kom_all,dataTable_kom,dataTable_prog" />
</rich:calendar>{code}