Examples of RawScript


Examples of org.openfaces.util.RawScript

        String fieldClass = Styles.getCSSClass(
                context, component, null, DEFAULT_FIELD_CLASS, paginator.getPageNumberFieldClass());
        inputText.setStyleClass(fieldClass);
        inputText.setOnkeypress("if (event.keyCode == 13) {this.onchange(); O$.stopEvent();}");
        Script selectPageNoScript = getSubmitComponentWithParamScript(
                useAjax, table, actionFieldName, new RawScript("'selectPageNo:' + this.value"), false);
        inputText.setOnchange(selectPageNoScript.toString());
        children.add(inputText);
        if (paginator.getShowPageCount()) {
            String pageCountPreposition = paginator.getPageCountPreposition();
            if (pageCountPreposition == null)
View Full Code Here

Examples of org.openfaces.util.RawScript

    private static Script getSubmitComponentWithParamScript(
            boolean useAjax, UIComponent table, String paramName, Object paramValue,
            boolean focusTable) {
        Script submitScript = useAjax
                ? new ScriptBuilder().functionCall("O$.Table._performPaginatorAction",
                table, new RawScript(focusTable ? "null" : "this"), paramName, paramValue).semicolon()
                : new ScriptBuilder().functionCall("O$.submitWithParam",
                new RawScript("this"), paramName, paramValue).semicolon();
        return submitScript;
    }
View Full Code Here

Examples of org.openfaces.util.RawScript

        final String id = ajax.getId();
        AjaxInitializer ajaxInitializer = new AjaxInitializer() {
            @Override
            protected Object getAjaxComponentParam(FacesContext context, OUICommand ajax) {
                return new RawScript("O$._actionIds['" + id + "']");
            }

            @Override
            protected Object getExecuteParam(FacesContext context, OUICommand ajax, Iterable<String> execute) {
                return new RawScript("O$._executeIds['" + id + "']");
            }
        };

        JSONArray renderArray = ajaxInitializer.getRenderArray(context, (OUICommand) action, ajax.getRender());
        String idExpression = "O$._renderIds['" + id + "']";
        Script render = new RawScript("(" + idExpression + " ? " + idExpression + " : " + renderArray.toString() + ")");

        buf.functionCall("O$._ajaxReload",
                render,
                ajaxInitializer.getAjaxParams(context, ajax)).semicolon();
        return buf.toString();
View Full Code Here

Examples of org.openfaces.util.RawScript

            addPresentationComponent(vc.getComponent(), vc.getParentForm(), bubbleIndex, vp);
        }
        if (!vp.getClientValidationRuleForComponent(vc).equals(ClientValidationMode.OFF)) {
            List<String> javascriptLibraries = vc.getJavascriptLibrariesUrls();
            String[] javascriptLibrariesArray = javascriptLibraries.toArray(new String[javascriptLibraries.size()]);
            Rendering.renderInitScript(context, new RawScript(commonScript.toString()), javascriptLibrariesArray);
        }

        if (clientValidationRuleForComponent.equals(ClientValidationMode.ON_SUBMIT)) {
            String formClientId = parentForm.getClientId(context);
            if (!formsHaveOnSubmitRendered.contains(formClientId)) {
                Rendering.renderInitScript(context,
                        new RawScript("O$.addOnSubmitEvent(O$._autoValidateForm,'" + formClientId + "');\n"),
                        ValidatorUtil.getValidatorUtilJsUrl(context));
                formsHaveOnSubmitRendered.add(formClientId);
            }
        } else if (clientValidationRuleForComponent.equals(ClientValidationMode.ON_DEMAND)) {
            Rendering.renderInitScript(context,
                    new RawScript("O$.addNotValidatedInput('" + vc.getClientId() + "');"),
                    ValidatorUtil.getValidatorUtilJsUrl(context));
        }
    }
View Full Code Here

Examples of org.openfaces.util.RawScript

        if (renderedMessages == null) {
            renderedMessages = new ArrayList();
            requestMap.put(messagesKey, renderedMessages);
        }
        if (renderedMessages.contains(message))
            return new RawScript("");
        renderedMessages.add(message);

        return new ScriptBuilder().functionCall("O$.addMessageById",
                clientId,
                message.getSummary(),
View Full Code Here

Examples of org.openfaces.util.RawScript

public class ValidatorUtil {
    private ValidatorUtil() {
    }

    public static void renderPresentationExistsForAllInputComponents(FacesContext context) throws IOException {
        Rendering.renderInitScript(context, new RawScript("O$._presentationExistsForAllComponents();"),
                Resources.utilJsURL(context),
                getValidatorUtilJsUrl(context));
    }
View Full Code Here

Examples of org.openfaces.util.RawScript

                        for (String s : messagesScripts) {
                            commonScript.append(s).append("\n");
                        }
                    }
                    String[] javascriptLibrariesArray = javascriptLibraries.toArray(new String[javascriptLibraries.size()]);
                    Rendering.renderInitScript(context, new RawScript(commonScript.toString()), javascriptLibrariesArray);

                    if (validationMode.equals(ClientValidationMode.ON_SUBMIT)) {
                        String formClientId = parentForm.getClientId(context);
                        Rendering.renderInitScript(context,
                                new RawScript("O$.addOnSubmitEvent(O$._autoValidateForm,'" + formClientId + "');\n"),
                                ValidatorUtil.getValidatorUtilJsUrl(context));

                    } else if (validationMode.equals(ClientValidationMode.ON_DEMAND)) {
                        Rendering.renderInitScript(context,
                                new RawScript("O$.addNotValidatedInput('" + child.getClientId(context) + "');"),
                                ValidatorUtil.getValidatorUtilJsUrl(context));
                    }


                }
View Full Code Here

Examples of org.openfaces.util.RawScript

    protected static final String DEFAULT_PREDEFINED_CRITERION_CLASS = "o_table_filter_predefined_criterion";

    protected String getFilterSubmissionScript(ExpressionFilter filter) {
        UIComponent component = (UIComponent) filter.getFilteredComponent();
        ExpressionFilter submittedFilter = Components.isChildComponent(filter, component) ? null : filter;
        return new ScriptBuilder().functionCall("O$.Filters._filterComponent", component, submittedFilter, new RawScript("this")).
                semicolon().toString();
    }
View Full Code Here

Examples of org.openfaces.util.RawScript

            if (isAjax4jsfRequest || isPortletRequest) {
                Rendering.renderInitScript(context, setMessageScript);
            } else {
                Rendering.appendOnLoadScript(context, setMessageScript);
                if (isAjaxCleanupRequired()) {
                    Rendering.appendOnLoadScript(context, new RawScript("O$.setAjaxCleanupRequired(true);"));
                }
            }
        }

    }
View Full Code Here

Examples of org.openfaces.util.RawScript

        renderInitScript(context, eventHandlingJavascript);
    }

    protected void renderInitScript(FacesContext context, String javaScript) throws IOException {
        AjaxUtil.renderAjaxSupport(context);
        Rendering.renderInitScript(context, new ScriptBuilder().onLoadScript(new RawScript(javaScript)));
    }
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.