StringBuffer script = new StringBuffer();
JSFunction function = new JSFunction("new Richfaces.PanelBar");
function.addParameter(panelBar.getClientId(context));
function.addParameter(options);
function.appendScript(script);
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.SCRIPT_ELEM, panelBar);
writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
String outerScript = script.append(";").toString();