public void renderView(FacesContext context, UIViewRoot root)
throws IOException, FacesException {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
// Broadcast Ajax events before rendering, to setup areas to update.
if (root instanceof AjaxViewRoot) {
AjaxViewRoot ajaxRoot = (AjaxViewRoot) root;
// broadcast ajax events before render response.
if (ajaxContext.isAjaxRequest()) {
processAjaxEvents(context, ajaxRoot);
if(ajaxContext.isSelfRender()){
// Render view directly.