*/
public void encodePollScript(FacesContext context, UIComponent component)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIProgressBar progressBar = (UIProgressBar) component;
String clientId = component.getClientId(context);
StringBuffer pollScript = new StringBuffer("\n");
StringBuffer script = new StringBuffer("\n");
if (isAjaxMode(component) && progressBar.isEnabled()) {
JSFunction function = AjaxRendererUtils.buildAjaxFunction(
component, context, AJAX_POLL_FUNCTION);
function.addParameter(new JSReference("$('" + clientId
+ "').component.options"));