コード例 #1
0
  @Deployment(testable = false)
  public static WebArchive createDeployment() {
    CoreDeployment deployment = new CoreDeployment(ITImplicitAjaxOutputRendering.class);

    deployment.withWholeCore();
    deployment.archive().addClasses(CounterBean.class);

    addIndexPage(deployment);

    return deployment.getFinalArchive();
  }
コード例 #2
0
  private static void addIndexPage(CoreDeployment deployment) {
    FaceletAsset p = new FaceletAsset();

    p.form("<r:commandButton id='button' render='@this' />");
    p.form("<r:commandButton id='buttonLimitRender' render='@this' limitRender='true' />");

    p.form("<r:outputPanel id='panel' ajaxRendered='true'>");
    p.form("    #{counterBean.incrementAndGet()}");
    p.form("</r:outputPanel>");

    deployment.archive().addAsWebResource(p, "index.xhtml");
  }
コード例 #3
0
  private static void addIndexPage(CoreDeployment deployment) {
    FaceletAsset p = new FaceletAsset();

    p.head("<h:outputScript name='jsf.js' library='javax.faces' />");
    p.head("<h:outputScript name='jquery.js' />");
    p.head("<h:outputScript name='richfaces.js' />");

    p.form("<h:panelGroup id='panel'>");
    p.form(
        "    <h:commandButton id='button' onclick='RichFaces.ajax(this, event, {}); return false;' render='panel output' oncomplete='window.oncompleteEvaluated = true' rendered='#{!facesContext.postback}' />");
    p.form("</h:panelGroup>");

    p.form(
        "<h:panelGroup id='output'>#{facesContext.postback ? 'postback' : 'initial'}</h:panelGroup>");

    deployment.archive().addAsWebResource(p, "index.xhtml");
  }
コード例 #4
0
  private static void addIndexPage(CoreDeployment deployment) {
    FaceletAsset p = new FaceletAsset();

    p.head("<h:outputScript name='jsf.js' library='javax.faces' />");
    p.head("<h:outputScript name='jquery.js' />");
    p.head("<h:outputScript name='richfaces.js' />");

    p.body("<h:form id='firstForm'>");
    p.body("    <h:inputText value='#{value}' />");
    p.body(
        "    <h:commandButton value='Submit 1' execute='@form' render='@form :secondForm' onclick='RichFaces.ajax(this, event, {\"incId\": \"1\"}); return false;' />");
    p.body("</h:form>");

    p.body("<h:form id='secondForm'>");
    p.body("    <h:inputText value='#{value}' />");
    p.body(
        "    <h:commandButton value='Submit 2' execute='@form' render='@form :firstForm' onclick='RichFaces.ajax(this, event, {\"incId\": \"1\"}); return false;'  />");
    p.body("</h:form>");

    deployment.archive().addAsWebResource(p, "index.xhtml");
  }