// Render only javascript responsible for handling button
ButtonScriptHandlerAttributes actionButtonAttributes =
(ButtonScriptHandlerAttributes) attributes;
ActionReference actionReference = actionButtonAttributes.getActionReference();
// Get disabled styles.
StylesExtractor stylesExtractor =
createStylesExtractor(protocol, attributes.getStyles());
stylesExtractor.setPseudoClass(StatefulPseudoClasses.MCS_DISABLED);
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.Button(")
.append(createJavaScriptString(actionButtonAttributes.getId()))
.append(",{")
.append("disabledStyle:" + stylesExtractor.getJavaScriptStyles());
if (actionReference != null) {
scriptBuffer.append(",action:")
.append(createJavaScriptExpression(actionReference));
addUsedWidgetId(actionReference.getWidgetId());
}
scriptBuffer.append("})");
if (attributes.getId() != null) {