if (!component.isRendered())
{
return;
}
HtmlSchedule schedule = (HtmlSchedule) component;
ResponseWriter writer = context.getResponseWriter();
//add needed CSS and Javascript files to the header
AddResource addResource = AddResourceFactory.getInstance(context);
String theme = getTheme(schedule);
//The default css file is only loaded if the theme is one of the provided
//themes.
if (DEFAULT_THEME.equals(theme) || OUTLOOK_THEME.equals(theme)
|| EVOLUTION_THEME.equals(theme))
{
addResource.addStyleSheet(context, AddResource.HEADER_BEGIN,
HtmlSchedule.class, CSS_RESOURCE);
}
addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
HtmlSchedule.class, "javascript/schedule.js");
addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
HtmlSchedule.class, "javascript/alphaAPI.js");
addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
HtmlSchedule.class, "javascript/domLib.js");
addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
HtmlSchedule.class, "javascript/domTT.js");
addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
HtmlSchedule.class, "javascript/fadomatic.js");
//hidden input field containing the id of the selected entry
writer.startElement(HTML.INPUT_ELEM, schedule);
writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
writer.writeAttribute(HTML.NAME_ATTR, schedule.getClientId(context),
"clientId");
writer.endElement(HTML.INPUT_ELEM);
//hidden input field containing the id of the last clicked date
writer.startElement(HTML.INPUT_ELEM, schedule);
writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
writer.writeAttribute(HTML.NAME_ATTR, schedule.getClientId(context)
+ "_last_clicked_date", "clicked_date");
writer.endElement(HTML.INPUT_ELEM);
//hidden input field containing the y coordinate of the mouse when
//the schedule was clicked. This will be used to determine the hour
//of day.
writer.startElement(HTML.INPUT_ELEM, schedule);
writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
writer.writeAttribute(HTML.NAME_ATTR, schedule.getClientId(context)
+ "_last_clicked_y", "clicked_y");
writer.endElement(HTML.INPUT_ELEM);
}