Package org.richfaces.shrinkwrap.descriptor

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset


        }
        waitGui().until().element(selectInput).attribute("value").equalTo("Tampa Bay");
    }

    private static void addIndexPage(RichDeployment deployment) {
        FaceletAsset p = new FaceletAsset();

        p.body("<h:form id='form'>");
        p.body("    <rich:select id='select'  enableManualInput='true'>");
        p.body("        <f:selectItems value='#{autocompleteBean.suggestions}' />");
        p.body("    </rich:select>");
        p.body("</h:form>");

        deployment.archive().addAsWebResource(p, "index.xhtml");
    }
View Full Code Here


        Assert.assertEquals("2 clicks", tabPanel.advanced().getTabHeaders().get(1).findElement(By.className("rf-tab-lbl")).getText());
    }


    private static void addIndexPage(RichDeployment deployment) {
        FaceletAsset p = new FaceletAsset();
        p.head("<script type='text/javascript'>");
        p.head("    window.onerror=function(msg) { ");
        p.head("        $('body').attr('JSError',msg);");
        p.head("    }");
        p.head("</script>");
        p.body("<h:form id='myForm'>");
        p.body("<rich:tabPanel id='tabPanel' ");
        p.body("               onbegin='$(\"#out\").append(\"begin \\n\")'");
        p.body("               oncomplete='$(\"#out\").append(\"tabpanel_complete \\n\")'");
        p.body("               onbeforedomupdate='$(\"#out\").append(\"beforedomupdate \\n\")'>");
        p.body("    <rich:tab id='tab0' name='tab0' header='tab0 header' ");
        p.body("               oncomplete='$(\"#out\").append(\"tab0_complete \\n\")'>");
        p.body("        content of tab 0");
        p.body("    </rich:tab>");
        p.body("    <rich:tab id='tab1' name='tab1' header='tab1 header' ");
        p.body("               execute='inputText'");
        p.body("               oncomplete='$(\"#out\").append(\"tab1_complete \\n\")'>");
        p.body("        content of tab 1");
        p.body("        <h:outputText id = 'outputText' value='#{simpleBean.string}' />");
        p.body("    </rich:tab>");
        p.body("</rich:tabPanel> ");
        p.body("<h:inputText id = 'inputText' value='#{simpleBean.string}' />");
        p.body("<div id='out'></div>");
        p.body("</h:form>");

        deployment.archive().addAsWebResource(p, "index.xhtml");
    }
View Full Code Here

        autocompleteInput.sendKeys(" ");
        waitGui().until().element(suggestionList).is().not().visible();
    }

    private static void addIndexPage(RichDeployment deployment) {
        FaceletAsset p = new FaceletAsset();

        p.body("<h:form id='form'>");
        p.body("    <rich:autocomplete id='autocomplete' mode='client' autocompleteList='#{autocompleteBean.suggestions}' tokens=',' autofill='#{param.autofill}' />");
        p.body("</h:form>");

        deployment.archive().addAsWebResource(p, "index.xhtml");
    }
View Full Code Here

    private WebElement getFocusedElement() {
        return FocusRetriever.retrieveActiveElement();
    }

    private static void addIndexPage(RichDeployment deployment) {
        FaceletAsset p = new FaceletAsset();

        p.body("<rich:focus id='focus' />");

        p.body("<h:form id='form1'>");

        p.body("    <h:inputText id='input1' required='true' />");
        p.body("    <h:inputText id='input2' tabindex='1' />");

        p.body("    <h:commandButton id='submit' value='Submit' />");

        p.body("    <h:commandButton id='ajax' value='Ajax'>");
        p.body("        <a4j:ajax execute='@form' render='@form' />");
        p.body("    </h:commandButton>");

        p.body("</h:form>");

        p.body("<h:form id='form2'>");

        p.body("    <h:inputText id='input1' />");
        p.body("    <h:inputText id='input2' tabindex='1' />");

        p.body("    <h:commandButton id='submit' value='Submit' />");

        p.body("    <h:commandButton id='ajax' value='Ajax'>");
        p.body("        <a4j:ajax render='@form' />");
        p.body("    </h:commandButton>");

        p.body("</h:form>");

        p.body("<h:form id='form3'>");
        p.body("    <rich:focus id='focus' preserve='true' />");

        p.body("    <h:inputText id='input1' />");
        p.body("    <h:inputText id='input2' tabindex='1' />");

        p.body("    <h:commandButton id='submit' value='Submit' />");

        p.body("    <h:commandButton id='ajax' value='Ajax'>");
        p.body("        <a4j:ajax render='@form' />");
        p.body("    </h:commandButton>");

        p.body("</h:form>");

        deployment.archive().addAsWebResource(p, "index.xhtml");
    }
View Full Code Here

            driver.getTitle(),
            equalTo("onbeforedomupdate ajaxbeforedomupdate javascriptServiceInProgress javascriptServiceComplete oncomplete ajaxcomplete"));
    }

    private static void addIndexPage(CoreDeployment deployment) {
        FaceletAsset p = new FaceletAsset();

        p.head("<title></title>");

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

        p.form("<h:commandButton id='jsfAjax' " + "onclick='jsf.ajax.request(this, event, {}); return false;' />");

        p.form("<h:commandButton id='richfacesAjax' " + "onclick='RichFaces.ajax(this, event, {}); return false;' "
            + "onbeforedomupdate=\"document.title += ' onbeforedomupdate'\" "
            + "oncomplete=\"document.title += ' oncomplete';\" />");

        p.form("<script>");
        p.form("$(document).on('ajaxbeforedomupdate', function() { document.title += ' ajaxbeforedomupdate'; })");
        p.form("$(document).on('ajaxcomplete', function() { document.title += ' ajaxcomplete'; })");
        p.form("$(document).on('javascriptServiceComplete', function() { document.title += ' javascriptServiceComplete'; })");
        p.form("</script>");

        deployment.archive().addAsWebResource(p, "index.xhtml");
    }
View Full Code Here

            assertEquals("Event callback was called even when it was not registered: " + callbacksToControll, " ", callbacksToControll);
        }
    }

    private static FaceletAsset buildPage(boolean formScopedRegistration, boolean pageScopedRegistration) {
        FaceletAsset p = new FaceletAsset();

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

        p.body("<h:outputScript>");
        p.body("  window.RichFaces.jQuery(document).ready(function() {");

        if (formScopedRegistration) {
            for (String eventCallback : EVENT_CALLBACKS) {
                registerCallBackToForm(p, eventCallback);
            }
        }

        if (pageScopedRegistration) {
            for (String eventCallback : EVENT_CALLBACKS) {
                registerCallBackToDocumentObject(p, eventCallback);
            }
        }

        p.body("    document.formScopedCallbacksCalled = ' ';");
        p.body("    document.documentScopedCallbacksCalled = ' ';");

        p.body("});");
        p.body("</h:outputScript>");

        p.body("<h:form prependId=\"false\" id=\"" + FORM_ID + "\">");
        p.body("  <h:inputText value=\"#{requestScope.property}\">");
        p.body("     <a4j:ajax event=\"keyup\" render=\"out\" />");
        p.body("  </h:inputText>");
        p.body("  <h:outputText value=\"#{requestScope.property}\" id=\"out\" />");
        p.body("</h:form>");

        return p;
    }
View Full Code Here

        assertTrue("the context of oncomplete function should be the source element (button)",
            (Boolean) executor.executeScript("return window.oncompleteContext === document.getElementById('button')"));
    }

    private static void addIndexPage(CoreDeployment deployment) {
        FaceletAsset p = new FaceletAsset();

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

        p.form("<h:commandButton id='button' "
                + "onclick='RichFaces.ajax(this, event, {}); return false;' "
                + "onbeforedomupdate='window.onbeforedomupdateContext = this' "
                + "oncomplete='window.oncompleteContext = this' />");

        deployment.archive().addAsWebResource(p, "index.xhtml");
View Full Code Here

                "/", Filters.includeAll());
        archive().addAsLibrary(jar);
    }

    public FaceletAsset baseFacelet(String name) {
        FaceletAsset p = new FaceletAsset();

        this.archive().add(p, name);

        return p;
    }
View Full Code Here

        } catch (NoSuchElementException e) {
        }
    }

    private static void addIndexPage(RichDeployment deployment) {
        FaceletAsset p = new FaceletAsset();

        p.head("<h:outputScript name='jsf.js' library='javax.faces' />");
        p.head("<h:outputScript library='org.richfaces' name='jquery.js' />");
        p.head("<h:outputScript library='org.richfaces' 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");
    }
View Full Code Here

        Graphene.guardHttp(buttonSkin3).click();
        Assert.assertEquals("plain button background-url is incorrect", "none", buttonSkin1.getCssValue("background-image"));
    }

    private static void addIndexPage(RichDeployment deployment) {
        FaceletAsset p = new FaceletAsset();
        p.form("<rich:panel id='panel' header='Header Text'>Some content ");
        p.form("    <h:inputText id='input' /> ");
        p.form("</rich:panel> ");
        p.form("<h:commandButton id='buttonSkin1' actionListener='#{skinTestBean.setSkin(\"blueSky\")}' value = 'Select skin 1' /> ");
        p.form("<h:commandButton id='buttonSkin2' actionListener='#{skinTestBean.setSkin(\"ruby\")}' value = 'Select skin 2' /> ");
        p.form("<h:commandButton id='buttonSkin3' actionListener='#{skinTestBean.setSkin(\"plain\")}' value = 'Select skin 3' /> ");
        deployment.archive().addAsWebResource(p, "index.xhtml");
    }
View Full Code Here

TOP

Related Classes of org.richfaces.shrinkwrap.descriptor.FaceletAsset

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.