Examples of AjaxInitializer


Examples of org.openfaces.component.ajax.AjaxInitializer

    protected String getExternalDropTargetId(FacesContext context, AbstractFileUpload abstractFileUpload){
        return Components.referenceIdToClientId(context, abstractFileUpload, abstractFileUpload.getExternalDropTarget());
    }

    protected JSONArray getRender(FacesContext context, AbstractFileUpload fileUpload) {
        AjaxInitializer ajaxInitializer = new AjaxInitializer();
        return ajaxInitializer.getRenderArray(context, fileUpload, fileUpload.getRender());
    }
View Full Code Here

Examples of org.openfaces.component.ajax.AjaxInitializer

        boolean ajaxJsRequired = false;
        if (render != null || (execute != null && execute.iterator().hasNext())) {
            if (render == null)
                throw new FacesException("'execute' attribute can't be specified without the 'render' attribute. Component id: " + getId());

            AjaxInitializer initializer = new AjaxInitializer();
            automaticChangeHandler = new ScriptBuilder().functionCall("O$._ajaxReload",
                    initializer.getRenderArray(context, this, render),
                    initializer.getAjaxParams(context, this)).semicolon().append("return false;");
            ajaxJsRequired = true;
        }
        onchange = Rendering.joinScripts(
                onchange,
                automaticChangeHandler != null ? automaticChangeHandler.toString() : null);
View Full Code Here

Examples of org.openfaces.component.ajax.AjaxInitializer

        Iterable<String> render = getRender();
        Iterable<String> execute = getExecute();
        final Chart chart = (Chart) getParent();

        if (render != null || (execute != null && execute.iterator().hasNext())) {
            AjaxInitializer initializer = new AjaxInitializer();
            JSONObject ajaxParams = initializer.getAjaxParams(context, this);
            MethodExpression actionExpression = getActionExpression();
            if (actionExpression != null) {
                String expr = actionExpression.getExpressionString().trim();
                if (!expr.startsWith("#{")) throw new FacesException("<o:selection> action expression is expected to start with #{ symbols: " + expr);
                expr = expr.substring(2, expr.length() - 1);
                try {
                    ajaxParams.put("_action", expr);
                } catch (JSONException e) {
                    throw new RuntimeException(e);
                }
            }
            automaticChangeHandler = new ScriptBuilder().functionCall("O$._ajaxReload",
                    initializer.getRenderArray(context, this, render),
                    ajaxParams).semicolon().append("return false;");
        } else {
            MethodExpression actionExpression = getActionExpression();
            if (actionExpression != null) {
                automaticChangeHandler = new ScriptBuilder().functionCall("O$.submitWithParam",
View Full Code Here

Examples of org.openfaces.component.ajax.AjaxInitializer

        boolean ajaxJsRequired = false;
        if (render != null || (execute != null && execute.iterator().hasNext())) {
            if (render == null)
                throw new FacesException("'execute' attribute can't be specified without the 'render' attribute. Component id: " + command.getId());

            AjaxInitializer initializer = new AjaxInitializer();
            componentClickHandler = new ScriptBuilder().functionCall("O$._ajaxReload",
                    initializer.getRenderArray(context, command, render),
                    initializer.getAjaxParams(context, command)).semicolon().append("return false;");
            ajaxJsRequired = true;
        } else {
            if (submitIfNoAjax != null) {
                componentClickHandler = new FunctionCallScript("O$.submitWithParam", command, submitIfNoAjax, true);
            }
View Full Code Here

Examples of org.openfaces.component.ajax.AjaxInitializer

        writer.startElement("span", ajax);
        writer.writeAttribute("style", "display: none", null);
        String clientId = ajax.getClientId(context);
        writer.writeAttribute("id", clientId, null);

        AjaxInitializer ajaxInitializer = new AjaxInitializer();
        ScriptBuilder initScript = new ScriptBuilder();
        initScript.initScript(context, ajax, "O$._initAjax",
                ajaxInitializer.getRenderArray(context, ajax, ajax.getRender()),
                ajaxInitializer.getAjaxParams(context, ajax));

        helper.appendMissingParameters(context, ajax, initScript);

        AjaxUtil.renderAjaxSupport(context);
        Rendering.renderInitScript(context, initScript);
View Full Code Here

Examples of org.openfaces.component.ajax.AjaxInitializer

        appendMissingParameters(context, ajax, javaScript);
    }

    protected String getClientActionScript(FacesContext context, OUIClientAction clientAction) {
        Ajax ajax = (Ajax) clientAction;
        AjaxInitializer initializer = new AjaxInitializer();
        ScriptBuilder script = new ScriptBuilder();
        script.functionCall("O$._ajaxReload",
                initializer.getRenderArray(context, ajax, ajax.getRender()),
                initializer.getAjaxParams(context, ajax)).semicolon();
        if (isDisableDefaultRequired(ajax))
            script.append("return false;");
        return script.toString();
    }
View Full Code Here

Examples of org.openfaces.component.ajax.AjaxInitializer

            parent = ((ComponentConfigurator) parent).getConfiguredComponent();
        }
        if (!isCommandComponent(parent)) {
            String ajaxComponentId = ajax.getId();
            script.append("if (!O$._renderIds) {O$._renderIds = []};O$._renderIds['").append(ajaxComponentId).append("'] = ");
            AjaxInitializer initializer = new AjaxInitializer();
            JSONArray idsArray = initializer.getRenderArray(context, ajax, ajax.getRender());
            script.append(idsArray);
            script.append(";");

            script.append("if (!O$._executeIds) {O$._executeIds = []};O$._executeIds['").append(ajaxComponentId).append("'] = ");
            JSONArray submittedIdsArray = initializer.getRenderArray(context, ajax, ajax.getExecute());
            if (!ajax.isStandalone() && ajax.getSubmitInvoker()) {
                String invokerId = OUIClientActionHelper.getClientActionInvoker(context, ajax);
                if (context.getViewRoot().findComponent(":" + invokerId) != null) {
                    // if invoker is a JSF component rather than raw HTML tag
                    submittedIdsArray.put(invokerId);
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.