Java Code Examples for javax.faces.application.Application#getViewHandler()

The following examples show how to use javax.faces.application.Application#getViewHandler() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StudentViewBean.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public void refresh() {
    FacesContext context = FacesContext.getCurrentInstance();
    Application application = context.getApplication();
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot viewRoot = viewHandler.createView(context, context
            .getViewRoot().getViewId());
    context.setViewRoot(viewRoot);
    context.renderResponse(); //Optional
}
 
Example 2
Source File: ApplicationBean.java    From yawl with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void refresh() {
    FacesContext context = FacesContext.getCurrentInstance();
    Application application = context.getApplication();
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot viewRoot = viewHandler.createView(context, context
            .getViewRoot().getViewId());
    context.setViewRoot(viewRoot);
}
 
Example 3
Source File: ApplicationBean.java    From yawl with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void refresh() {
      FacesContext context = FacesContext.getCurrentInstance();
      Application application = context.getApplication();
      ViewHandler viewHandler = application.getViewHandler();
      UIViewRoot viewRoot = viewHandler.createView(context, context
           .getViewRoot().getViewId());
      context.setViewRoot(viewRoot);
    //  context.renderResponse(); //Optional
}
 
Example 4
Source File: TestProject.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
public static UIViewRoot loadEmptyPage(AbstractXspTest test, FacesContext context) throws Exception{
    String pageName = "/pages/pregenerated/empty.xsp";
    Application application = lazyApplication(test);
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot root = viewHandler.createView(context, pageName);
    if( null == root ){
        throw new RuntimeException("JUnit test could not load the empty page "+pageName);
    }
    context.setViewRoot(root);
    return root;
}
 
Example 5
Source File: TestProject.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
public static UIViewRoot loadView(AbstractXspTest test,
        FacesContext context, String viewId) throws Exception{
    
    String pageName = toPageName(viewId);
    Application application = lazyApplication(test);
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot root = viewHandler.createView(context, pageName);
    if( null != root ){
        context.setViewRoot(root);
    }
    return root;
}
 
Example 6
Source File: StudentViewBean.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public void refresh() {
    FacesContext context = FacesContext.getCurrentInstance();
    Application application = context.getApplication();
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot viewRoot = viewHandler.createView(context, context
            .getViewRoot().getViewId());
    context.setViewRoot(viewRoot);
    context.renderResponse(); //Optional
}