JSFunction function = new JSFunction(AJAX_POLL_FUNCTION);
Map<String, Object> options = new HashMap<String, Object>();
RenderKitUtils.addToScriptHash(options, "interval", poll.getInterval(), "1000");
// RenderKitUtils.addToScriptHash(options, "pollId", component.getClientId(context));
HandlersChain handlersChain = new HandlersChain(context, poll);
handlersChain.addInlineHandlerFromAttribute(AbstractPoll.ON_TIMER);
handlersChain.addBehaviors(AbstractPoll.TIMER);
handlersChain.addAjaxSubmitFunction();
String handler = handlersChain.toScript();
if (handler != null) {
JSFunctionDefinition timerHandler = new JSFunctionDefinition(JSReference.EVENT);
timerHandler.addToBody(handler);
options.put(AbstractPoll.ON_TIMER, timerHandler);