}
protocol.writeCloseSpan(spanAttributes);
// Render the Property Display controller.
DisplayAttributes propertyDisplayAttributes = (DisplayAttributes) attributes;
PropertyReference propertyReference = propertyDisplayAttributes.getPropertyReference();
StringBuffer scriptBuffer = new StringBuffer();
// Finally, render the JavaScript part.
if (attributes.getId() != null) {
scriptBuffer.append("Widget.register(")
.append(createJavaScriptString(attributes.getId()))
.append(",");
addCreatedWidgetId(attributes.getId());
}
scriptBuffer.append("new Widget.Display(")
.append(createJavaScriptString(spanAttributes.getId()))
.append(",{");
if (propertyReference != null) {
scriptBuffer.append("property:")
.append(createJavaScriptExpression(propertyReference));
addUsedWidgetId(propertyReference.getWidgetId());
}
String content = propertyDisplayAttributes.getContent();
if (content != null){
scriptBuffer.append("content:")
.append(createJavaScriptString(content));