*/
@SuppressWarnings("unchecked")
static public void service(FacesContext context)
throws IOException
{
RenderingContext arc = RenderingContext.getCurrentInstance();
CoreDocument doc = new CoreDocument();
context.getViewRoot().getChildren().add(doc);
doc.setTitle(arc.getTranslatedString(_DIALOG_TITLE_KEY));
CoreForm form = new CoreForm();
doc.getChildren().add(form);
form.setId("a");
boolean isDesktop = (arc.getAgent().getType().equals(Agent.TYPE_DESKTOP));
//
// Create the calendar row
//
UIComponent calendarRow = _createRow(isDesktop,
XhtmlConstants.H_ALIGN_END);
CoreChooseDate ccd = CalendarUtils.createChooseDate(context);
calendarRow.getChildren().add(ccd);
// Get a destination that points back to this dialog, including
// any viewIDs
String destination =
GenericEntry.getGenericEntryURL(context,
GenericEntry.CALENDAR_DIALOG_ENTRY);
ccd.getAttributes().put("destination", destination);
//
// Create a spacer
//
UIComponent spacerRow = _createRow(isDesktop, null);
CoreSpacer cos = new CoreSpacer();
spacerRow.getChildren().add(cos);
cos.setHeight("8");
//
// Create the button row
//
UIComponent buttonRow = _createRow(isDesktop, XhtmlConstants.H_ALIGN_END);
CoreGoButton cancelButton =
JspUtils.createGoButton(arc, _CANCEL_LABEL_KEY);
buttonRow.getChildren().add(cancelButton);
Object cap = arc.getAgent().getCapabilities().get(
TrinidadAgent.CAP_MULTIPLE_WINDOWS);
boolean multWindowsSupported = Boolean.TRUE.equals( cap );
if (multWindowsSupported )
{
cancelButton.setOnclick("return _doCancel()");