Examples of FaceletAsset


Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

                .inspect(new VerifyMenuAction.DidNotOccur());

    }

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

        //  Re-enable the disabled javascript with this custom javascript call
        p.body("<script type='text/javascript'> ");
        p.body("    function enableMenu() { ");
        p.body("        new RichFaces.ui.PanelMenuItem('disabledMenu',{'unselectable':false,'selectable':true,'name':'Item_2','ajax':{'incId':'1'} , 'disabled':false,'mode':'ajax'} )");
        p.body("    } ");
        p.body("    jQuery(enableMenu); ");
        p.body("</script>");

        p.form("<rich:panelMenu itemMode='ajax' groupMode='ajax'>");
        p.form("    <rich:panelMenuGroup label='Group' expanded='true'> ");
        p.form("        <rich:panelMenuItem id='enabledMenu' label='Item 1' styleClass='enabled' name='Item_1' action='#{panelMenuBean.doAction}'  />");
        p.form("        <rich:panelMenuItem id='disabledMenu' label='Item 2' styleClass='disabled' disabled='true' name='Item_2' action='#{panelMenuBean.doAction}'  />");
        p.form("    </rich:panelMenuGroup> ");
        p.form("</rich:panelMenu>");

        deployment.archive().addAsWebResource(p, "disabled-menu-item.xhtml");
    }
View Full Code Here

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

        addIndexPage(deployment);
        return deployment.getFinalArchive();
    }

    private static void addIndexPage(RichDeployment deployment) {
        FaceletAsset p = new FaceletAsset();
        p.head("<style type='text/css'>");
        p.head(".richfaces-chart {");
        p.head("width: 600px;");
        p.head("height: 400px;");
        p.head("}");
        p.head("</style>");
        p.head("    <script type='text/javascript'>");
        p.head("//<![CDATA[");
        p.head("function logClick(event){");
        p.head("    $('#clickInfo').text(event.data.x+','+event.data.y);");
        p.head("}");
        p.head("function hover(e){");
        p.head("    $('#hoverInfo').text(e.data.item.series.label+' ['+e.data.x+','+e.data.y+']');");
        p.head("}");
        p.head("function clear(){");
        p.head("    $('#hoverInfo').text('');");
        p.head("}");
        p.head("//]]>");
        p.head("</script>");

        p.body("<h:form id='frm'>");
        p.body("<rich:chart id='chart' zoom ='true' title='ChartTitle' onplotclick='logClick(event)' onplothover='hover(event)' onmouseout='clear()' plotClickListener='#{chartBean.handler}' >");
        p.body("    <a4j:repeat value='#{chartBean.countries}' var='country'>");
        p.body("                <rich:chartSeries label='#{country.name}' type='line'>");
        p.body("                    <a4j:repeat value='#{country.data}' var='record'>");
        p.body("                        <rich:chartPoint x='#{record.year}' y='#{record.tons}' />");
        p.body("                    </a4j:repeat>");
        p.body("                </rich:chartSeries>");
        p.body("            </a4j:repeat>");
        p.body("    <a4j:ajax event='plotclick' render='msg' execute='msg' />");
        p.body("    <rich:chartXAxis label='year' />");
        p.body("    <rich:chartYAxis label='metric tons of CO2 per capita' />");
        p.body("</rich:chart>");
        p.body("<h:outputText id='msg' value='#{chartBean.msg}' />");
        p.body("</h:form>");
        p.body("<span id='clickInfo'></span>");
        p.body("<br />");
        p.body("<span id='hoverInfo'></span>");

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

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

    }

    private static void addIndexPage(RichDeployment deployment) {
        String edtAttributes =
               "            id='edt' value='#{iterationTableStateBean.values}' var='bean' ";
        FaceletAsset p = getPage(edtAttributes);

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

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

    private static void addWidthPage(RichDeployment deployment) {
        String edtAttributes =
               "            id='edt' value='#{iterationTableStateBean.values}' var='bean' " +
               "            tableState='#{iterationTableStateBean.widthState}'";
        FaceletAsset p = getPage(edtAttributes);

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

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

    private static void addSortPage(RichDeployment deployment) {
        String edtAttributes =
               "            id='edt' value='#{iterationTableStateBean.values}' var='bean' " +
               "            tableState='#{iterationTableStateBean.sortState}'";
        FaceletAsset p = getPage(edtAttributes);

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

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

    private static void addFilterPage(RichDeployment deployment) {
        String edtAttributes =
               "            id='edt' value='#{iterationTableStateBean.values}' var='bean' " +
               "            tableState='#{iterationTableStateBean.filterState}'";
        FaceletAsset p = getPage(edtAttributes);

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

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

    private static void addOrderPage(RichDeployment deployment) {
        String edtAttributes =
               "            id='edt' value='#{iterationTableStateBean.values}' var='bean' " +
               "            columnsOrder='#{iterationTableStateBean.columnsOrder}'" +
               "            tableState='#{iterationTableStateBean.orderState}'";
        FaceletAsset p = getPage(edtAttributes);

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

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

        Assert.assertTrue(cells.get(1).getAttribute("class").contains("d2"));
        Assert.assertTrue(cells.get(2).getAttribute("class").contains("d1"));
    }

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

        p.form("<rich:extendedDataTable id='edt' ");
        p.form("                        value='#{iterationBean.values}' ");
        p.form("                        var='bean' ");
        p.form("                        columnsOrder='${iterationBean.columnsOrder}' ");
        p.form("> ");
        p.form("    <rich:column id='column1' styleClass='d1' > ");
        p.form("        <f:facet name='header'>Column 1</f:facet> ");
        p.form("        <h:outputText value='Bean:' /> ");
        p.form("    </rich:column> ");
        p.form("    <rich:column id='column2' styleClass='d2'>");
        p.form("        <f:facet name='header'>Column 2</f:facet> ");
        p.form("        <h:outputText value='#{bean}' /> ");
        p.form("    </rich:column> ");
        p.form("    <rich:column id='column3' styleClass='d3'>" );
        p.form("        <f:facet name='header'>Column 3</f:facet> ");
        p.form("        <h:outputText value='Row #{bean}, Column 3' /> ");
        p.form("    </rich:column> ");
        p.form("</rich:extendedDataTable> ");
        p.form("Columns order: <h:outputText id='output' value='#{iterationBean.columnsOrderString}' /> " );
        p.form("<br /> " );
        p.form("<a4j:commandButton id= 'button' " );
        p.form("     render='edt,output' ");
        p.form("     action='#{iterationBean.setColumnsOrder(\"column3,column2,column1\")}' />");


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

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

        List<WebElement> filterInputs = browser.findElements(By.cssSelector(".rf-edt-flt-i"));
        Assert.assertEquals(0, filterInputs.size());
    }

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

        p.body("<script type='text/javascript'>");
        p.body("function sortEdt(currentSortOrder) { ");
        p.body("  var edt = RichFaces.component('myForm:edt'); ");
        p.body("  var sortOrder = currentSortOrder == 'ascending' ? 'descending' : 'ascending'; ");
        p.body("  edt.sort('column2', sortOrder, true); ");
        p.body("} ");
        p.body("function filterEdt(filterValue) { ");
        p.body("  var edt = RichFaces.component('myForm:edt'); ");
        p.body("  edt.filter('column2', filterValue, true); ");
        p.body("} ");
        p.body("</script>");
        p.body("<h:form id='myForm'> ");
        p.body("    <rich:extendedDataTable id='edt' value='#{iterationBuiltInBean.values}' var='bean' filterVar='fv' > ");
        p.body("        <rich:column id='column1' width='150px' > ");
        p.body("            <f:facet name='header'>Column 1</f:facet> ");
        p.body("            <h:outputText value='Bean:' /> ");
        p.body("        </rich:column> ");
        p.body("        <rich:column id='column2' width='150px' ");
        p.body("                         sortBy='#{bean}' ");
        p.body("                         sortOrder='#{iterationBuiltInBean.sortOrder}' ");
        p.body("                         filterValue='#{iterationBuiltInBean.filterValue}' ");
        p.body("                         filterExpression='#{bean le fv}' > ");
        p.body("            <f:facet name='header'>Column 2</f:facet> ");
        p.body("            <h:outputText value='#{bean}' /> ");
        p.body("        </rich:column> ");
        p.body("        <rich:column id='column3' width='150px'" );
        p.body("                     sortBy='#{bean}' ");
        p.body("                     sortOrder='#{iterationBuiltInBean.sortOrder2}' > ");
        p.body("            <f:facet name='header'>Column 3</f:facet> ");
        p.body("            <h:outputText value='Row #{bean}, Column 3' /> ");
        p.body("        </rich:column> ");
        p.body("    </rich:extendedDataTable> ");
        p.body("    <a4j:commandButton id='ajax' execute='edt' render='edt' value='Ajax' /> ");
        p.body("</h:form> ");

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

Examples of org.richfaces.shrinkwrap.descriptor.FaceletAsset

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

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

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

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

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

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

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

        deployment.archive().addAsWebResource(p, "index.xhtml");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.