Examples of addPageReadyScript()


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

        if (isComponentMessages(component)) {
            parametersBuilder.put("isMessages", true);
        }
        messageObject.addParameter(parametersBuilder.build());
        // RendererUtils.getInstance().writeScript(facesContext, component, messageObject);
        javaScriptService.addPageReadyScript(facesContext, messageObject);
    }

    protected String getMsgClass(FacesContext facesContext, UIComponent component, Object msg) throws IOException {
        MessageForRender message = (MessageForRender) msg;
        SeverityAttributes severityAttributes = SEVERITY_MAP.get(message.getSeverity());
View Full Code Here

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

        for (MessageForRender message : getVisibleMessages(facesContext, component)) {
            JSFunction notifyCall = new JSFunction("RichFaces.ui.Notify");
            Map<String, Object> optionsCopy = new LinkedHashMap<String, Object>(options);
            addMessageSpecificAttributes(message, facesContext, component, optionsCopy);
            notifyCall.addParameter(optionsCopy);
            javaScriptService.addPageReadyScript(facesContext, notifyCall);
            message.rendered();
        }
    }

    private void addMessageSpecificAttributes(MessageForRender message, FacesContext facesContext, UIComponent component,
View Full Code Here

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

            if (component instanceof EditableValueHolder) {
                String clientId = component.getClientId(facesContext);
                final ImmutableList<Message> messages = ImmutableList.copyOf(Iterators.transform(facesContext.getMessages(clientId), MESSAGES_TRANSFORMER));

                JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
                javaScriptService.addPageReadyScript(facesContext, new MessageUpdateScript(clientId, messages));

                if (messages.isEmpty()) {
                    final String onvalid = getOnvalid();
                    if (onvalid != null && !"".equals(onvalid.trim())) {
                        javaScriptService.addPageReadyScript(facesContext, new AnonymousFunctionCall().addToBody(onvalid));
View Full Code Here

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

                javaScriptService.addPageReadyScript(facesContext, new MessageUpdateScript(clientId, messages));

                if (messages.isEmpty()) {
                    final String onvalid = getOnvalid();
                    if (onvalid != null && !"".equals(onvalid.trim())) {
                        javaScriptService.addPageReadyScript(facesContext, new AnonymousFunctionCall().addToBody(onvalid));
                    }
                } else {
                    final String oninvalid = getOninvalid();
                    if (oninvalid != null && !"".equals(oninvalid.trim())) {
                        javaScriptService.addPageReadyScript(facesContext, new AnonymousFunctionCall("messages").addParameterValue(ScriptUtils.toScript(messages)).addToBody(oninvalid));
View Full Code Here

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

                        javaScriptService.addPageReadyScript(facesContext, new AnonymousFunctionCall().addToBody(onvalid));
                    }
                } else {
                    final String oninvalid = getOninvalid();
                    if (oninvalid != null && !"".equals(oninvalid.trim())) {
                        javaScriptService.addPageReadyScript(facesContext, new AnonymousFunctionCall("messages").addParameterValue(ScriptUtils.toScript(messages)).addToBody(oninvalid));
                    }
                }
            }
        }
        super.broadcast(event);
View Full Code Here

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

            parametersBuilder.put("isMessages", true);
        }
        messageObject.addParameter(parametersBuilder.build());
        messageObject.addParameter(options);
        // RendererUtils.getInstance().writeScript(facesContext, component, messageObject);
        javaScriptService.addPageReadyScript(facesContext, messageObject);
    }

    protected void encodeNotification(FacesContext facesContext, UIComponent component, Map<String, Object> options)
            throws IOException {
        JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
View Full Code Here

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

                String clientId = component.getClientId(context);

                setContextAttribute(context, clientId);

                JavaScriptService javaScriptService = ServiceTracker.getService(context, JavaScriptService.class);
                javaScriptService.addPageReadyScript(context, new JSLiteral(String.format(SCRIPT, clientId)));
            }
        }
    }

    private void setContextAttribute(FacesContext context, String clientId) {
View Full Code Here

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

    }

    public String action() {
        JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
        FacesContext facesContext = FacesContext.getCurrentInstance();
        javaScriptService.addPageReadyScript(facesContext, SCRIPT);
        return null;
    }
}
View Full Code Here

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

    private static JSLiteral POPOVER_INIT_CODE = new JSLiteral("$('[rel=popover]').popover();");
   
    public void ensureInitCode(FacesContext facesContext) {
        JavaScriptService service = ServiceTracker.getService(JavaScriptService.class);
       
        service.addPageReadyScript(facesContext, POPOVER_INIT_CODE);
    }
}
View Full Code Here

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

    private static JSLiteral TOOLTIP_INIT_CODE = new JSLiteral("$('[rel=tooltip]').tooltip();");
   
    public void ensureInitCode(FacesContext facesContext) {
        JavaScriptService service = ServiceTracker.getService(JavaScriptService.class);
       
        service.addPageReadyScript(facesContext, TOOLTIP_INIT_CODE);
    }
}
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.