public String getActionScript(FacesContext context, UIComponent component) throws IOException {
String clientId = component.getClientId(context);
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, context);
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(FileUploadConstants.FILE_UPLOAD_ACTION, new JSReference("action"));
parameters.put(FileUploadConstants.UPLOAD_FILES_ID, new JSReference("uid"));
parameters.put(AjaxRendererUtils.AJAX_SINGLE_ATTR, clientId);
Map options = AjaxRendererUtils.buildEventOptions(context, component, parameters, true);
options.put("onbeforedomupdate", new JSReference("callback"));
ajaxFunction.addParameter(options);
JSFunctionDefinition function = new JSFunctionDefinition("uid", "action", "callback");
function.addParameter("event");