UIForm parentForm = getParentForm(schedule);
TreeSet entrySet = new TreeSet(comparator);
for (Iterator entryIterator = day.iterator(); entryIterator.hasNext();)
{
ScheduleEntry entry = (ScheduleEntry) entryIterator.next();
entrySet.add(entry);
}
for (Iterator entryIterator = entrySet.iterator(); entryIterator
.hasNext();)
{
ScheduleEntry entry = (ScheduleEntry) entryIterator.next();
writer.startElement(HTML.TR_ELEM, schedule);
writer.startElement(HTML.TD_ELEM, schedule);
if (isSelected(schedule, entry))
{
writer.writeAttribute(HTML.CLASS_ATTR, "selected", null);
}
writer.writeAttribute(HTML.STYLE_ATTR, "width: 100%", null);
//draw the tooltip
if (showTooltip(schedule))
{
writer.writeAttribute("onmouseover", getTooltipText(entry,
schedule), null);
}
if (!isSelected(schedule, entry) && !schedule.isReadonly())
{
writer.startElement("a", schedule);
writer.writeAttribute("href", "#", null);
String clientId = schedule.getClientId(context);
StringBuffer mousedown = new StringBuffer();
mousedown.append("document.forms['");
mousedown.append(parentForm.getClientId(context));
mousedown.append("']['");
mousedown.append(clientId);
mousedown.append("'].value='");
mousedown.append(entry.getId());
mousedown.append("'; document.forms['");
mousedown.append(parentForm.getClientId(context));
mousedown.append("'].submit()");
writer
.writeAttribute("onmousedown", mousedown.toString(),