writer.write(new JSFunction("RichFaces.ui.Focus.setFocus", targetClientId, priority, clientId,
uiFocus.getTiming()).toScript());
writer.write(";");
}
if (uiFocus.getName() != null && !uiFocus.getName().trim().equals("")) {
final JSFunctionDefinition definition = new JSFunctionDefinition().addToBody(new JSFunction("RichFaces.ui.Focus.focusStored", clientId));
definition.setName(uiFocus.getName());
writer.write(definition.toScript());
writer.write(";");
}
writer.endElement(HtmlConstants.SCRIPT_ELEM);
}