}
br.doEndTag(writer);
//Emit javascript if this button needs to sumbit the form or open a popup window
if (idScript != null || _popupSupport != null || buttonDisable || buttonDisableAndSubmit) {
ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
InternalStringBuilder script = new InternalStringBuilder(32);
StringBuilderRenderAppender scriptWriter = new StringBuilderRenderAppender(script);
IScriptReporter sr = getScriptReporter();
if (buttonDisableAndSubmit)
srs.writeFeature(sr, scriptWriter, CoreScriptFeature.BUTTON_DISABLE_AND_SUBMIT, true, false, null);
if (buttonDisable)
srs.writeFeature(sr, scriptWriter, CoreScriptFeature.BUTTON_DISABLE, true, false, null);
if (_popupSupport != null)
_popupSupport.writeScript(request, srs, getScriptReporter(), scriptWriter);
if (idScript != null)
scriptWriter.append(idScript);
write(script.toString());