// Javadoc inherited.
public void doRenderClose(VolantisProtocol protocol,
MCSAttributes attributes) throws ProtocolException {
// Render XHTML2 TABLE element opening
TableAttributes tableAttributes = (TableAttributes) attributes;
// close table element no matter widget is supported or not
protocol.writeCloseTable(tableAttributes.getXHTML2Attributes());
if (isWidgetSupported(protocol)) {
// Prepare buffer for JavaScript
StringBuffer script = new StringBuffer();
// Render JavaScript to buffer
if (attributes.getId() != null) {
script.append(createJavaScriptWidgetRegistrationOpening(attributes.getId(), true));
}
script.append("new Widget.Table(")
.append(createJavaScriptString(tableAttributes.getXHTML2Attributes().getId()))
.append(")");
if (attributes.getId() != null) {
script.append(createJavaScriptWidgetRegistrationClosure());
}