require(WIDGET_GALLERY, protocol, attributes, true);
}
private void renderCloseForWidget(VolantisProtocol protocol, ItemsAttributes attributes)
throws ProtocolException {
LoadAttributes loadAttributes = attributes.getLoadAttributes();
// Finally, render the JavaScript part.
String itemsId = attributes.getId();
if (itemsId == null) {
itemsId = protocol.getMarinerPageContext().generateFCID("GALLERY_ITEMS");
}
StringBuffer buffer = new StringBuffer();
buffer.append("Widget.register(")
.append(createJavaScriptString(itemsId))
.append(", ")
.append("Gallery.createItems({");
addCreatedWidgetId(itemsId);
// There were no items rendered.
if (loadAttributes != null) {
// If items are to be loaded, render items as null.
buffer.append("loadURL:" + createJavaScriptString(loadAttributes.getSrc()));
if (loadAttributes.getWhen() != null) {
if (loadAttributes.getWhen().equals("defer")) {
buffer.append(",loadOnDemand:true");
} if (loadAttributes.getWhen().equals("onload")) {
buffer.append(",loadOnDemand:false");
}
}
} else {