Package org.richfaces.javascript

Examples of org.richfaces.javascript.JavaScriptService.addScript()


    @Override
    protected void preEncodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
        ScriptString script = prepareCSVMessageScript(facesContext);

        JavaScriptService jsService = ServiceTracker.getService(JavaScriptService.class);
        jsService.addScript(facesContext, script);
    }

    /**
     * Prepares client-side validation script for {@link SelectLabelValueValidator}
     */
 
View Full Code Here


    String buildAndStoreValidatorScript(ClientBehaviorContext behaviorContext, ClientValidatorBehavior behavior) {
        ComponentValidatorScript validatorScript = createValidatorScript(behaviorContext, behavior);
        if (null != validatorScript) {
            FacesContext facesContext = behaviorContext.getFacesContext();
            JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
            validatorScript = javaScriptService.addScript(facesContext, validatorScript);
            return validatorScript.createCallScript(behaviorContext.getComponent().getClientId(facesContext),
                    behaviorContext.getSourceId());
        } else {
            return null;
        }
View Full Code Here

    /**
     * This method ensures that component which should be focused will be present in the page in the time of running script (oncomplete).
     */
    public void renderOncompleteScript(FacesContext context, String script) {
        JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
        javaScriptService.addScript(context, new JSLiteral(script));
    }

    private FocusRenderStrategy getStrategy(AbstractFocus component) {
        switch (component.getMode()) {
            case FORM:
View Full Code Here

        if (script == null) {
            return;
        }

        JavaScriptService service = ServiceTracker.getService(JavaScriptService.class);
        service.addScript(context, script);
    }

    protected Object getScriptObject(FacesContext context, UIComponent component) {
        return null;
    }
View Full Code Here

    protected void addOnCompleteParam(FacesContext context, String itemName, String panelId) {
        String script = new StringBuilder().append("RichFaces.component('").append(panelId).append("').onCompleteHandler('")
                .append(itemName).append("');").toString();

        JavaScriptService scriptService = ServiceTracker.getService(JavaScriptService.class);
        scriptService.addScript(context, new JSLiteral(script.toString()));
    }
}
View Full Code Here

        if (script == null) {
            return;
        }

        JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
        javaScriptService.addScript(context, script);
    }

    public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId) throws IOException {
        if (AbstractTooltip.CONTENT_META_COMPONENT_ID.equals(metaComponentId)) {
            AbstractTooltip tooltip = (AbstractTooltip) component;
View Full Code Here

        if (script == null) {
            return;
        }

        JavaScriptService service = ServiceTracker.getService(JavaScriptService.class);
        service.addScript(context, script);
    }

    protected Object getScriptObject(FacesContext context, UIComponent component) {
        return null;
    }
View Full Code Here

    protected void addOnCompleteParam(FacesContext context, String itemName, String panelId) {
        String script = new StringBuilder().append("RichFaces.$('").append(panelId).append("').onCompleteHandler('")
                .append(itemName).append("');").toString();

        JavaScriptService scriptService = ServiceTracker.getService(JavaScriptService.class);
        scriptService.addScript(context, new JSLiteral(script.toString()));
    }
}
View Full Code Here

        if (script == null) {
            return;
        }

        JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
        javaScriptService.addScript(context, script);
    }

    public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId) throws IOException {
        if (AbstractTooltip.CONTENT_META_COMPONENT_ID.equals(metaComponentId)) {
            AbstractTooltip tooltip = (AbstractTooltip) component;
View Full Code Here

    /**
     * This method ensures that component which should be focused will be present in the page in the time of running script (oncomplete).
     */
    public void renderOncompleteScript(FacesContext context, String script) {
        JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
        javaScriptService.addScript(context, new JSLiteral(script));
    }

    private FocusRenderStrategy getStrategy(AbstractFocus component) {
        switch (component.getMode()) {
            case FORM:
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.