protected void encodeScript(FacesContext context, AjaxStatus status) throws IOException {
String clientId = status.getClientId(context);
WidgetBuilder wb = getWidgetBuilder(context);
wb.initWithDomReady("AjaxStatus", status.resolveWidgetVar(), clientId);
wb.callback(AjaxStatus.START, AjaxStatus.CALLBACK_SIGNATURE, status.getOnstart())
.callback(AjaxStatus.ERROR, AjaxStatus.CALLBACK_SIGNATURE, status.getOnerror())
.callback(AjaxStatus.SUCCESS, AjaxStatus.CALLBACK_SIGNATURE, status.getOnsuccess())
.callback(AjaxStatus.COMPLETE, AjaxStatus.CALLBACK_SIGNATURE, status.getOncomplete());
wb.finish();