// Retrieve block attributes stored in doRenderOpen
EffectBlockAttributes blockAttributes = (EffectBlockAttributes)popMCSAttributes();
renderWidgetClose(protocol, blockAttributes);
addUsedWidgetId(blockAttributes.getId());
DatePickerAttributes datePickerAttributes = (DatePickerAttributes) attributes;
// Create the widget
StringBuffer textBuffer = new StringBuffer(createJavaScriptWidgetRegistrationOpening(attributes.getId()))
.append("new Widget.DatePicker(")
.append(createJavaScriptString(attributes.getId()))
.append(", ").append(createJavaScriptString(blockAttributes.getId()))
.append(", {");
if (datePickerAttributes.getInputField() != null) {
textBuffer.append("inputField:").append(createJavaScriptString(datePickerAttributes.getInputField())).append(", ");
} else {
if (datePickerAttributes.getDayInputField() != null) {
textBuffer.append("dayInputField:").append(createJavaScriptString(datePickerAttributes.getDayInputField())).append(", ");
}
if (datePickerAttributes.getMonthInputField() != null) {
textBuffer.append("monthInputField:").append(createJavaScriptString(datePickerAttributes.getMonthInputField())).append(", ");
}
if (datePickerAttributes.getYearInputField() != null) {
textBuffer.append("yearInputField:").append(createJavaScriptString(datePickerAttributes.getYearInputField())).append(", ");
}
}
if (calendarDisplayId!=null)
textBuffer.append("calendarDisplayId:").append(createJavaScriptString(calendarDisplayId)).append(", ");
Styles styles = attributes.getStyles();
StyleValue unfoldon = styles.getPropertyValues().getSpecifiedValue(StylePropertyDetails.MCS_TOGGLE_EVENT);
if (unfoldon != null)
textBuffer.append("unfoldon: ").append(createJavaScriptString(unfoldon.getStandardCSS())).append(", ");
LoadAttributes loadAttributes = datePickerAttributes.getLoadAttributes();
if (loadAttributes != null) {
String load = "load_src: " + createJavaScriptString(loadAttributes.getSrc())
+ ", load_when: " + createJavaScriptString(loadAttributes.getWhen()) + ", ";
textBuffer.append(load);
}