Package org.richfaces.javascript

Examples of org.richfaces.javascript.JSReference


    private final static class AjaxSubmitFunctionResourceRenderer extends Renderer implements UserResourceRenderer2 {
        public void encodeToHead(FacesContext facesContext, UIComponent component) throws IOException {
            JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, facesContext);
            Map<String, Object> options = AjaxRendererUtils.buildEventOptions(facesContext, component, true);

            options.put("requestDelay", new JSReference("options.requestDelay"));
            options.put("similarityGroupingId",
                    new JSReference("options.similarityGroupingId || '" + component.getClientId(facesContext)
                            + "'"));
            options.put("data", new JSReference("data"));
            options.put("requestTime", new JSReference("options.requestTime"));
            options.put("timeout", new JSReference("options.timeout"));
            options.put("eventsQueue", new JSReference("options.eventsQueue"));
            options.put("implicitEventsQueue", new JSReference("options.implicitEventsQueue"));
            options.put("ignoreDupResponses", new JSReference("options.ignoreDupResponses"));
            ajaxFunction.addParameter(options);

            ResponseWriter responseWriter = facesContext.getResponseWriter();

            responseWriter.startElement(HTML.SCRIPT_ELEM, component);
View Full Code Here


        return (JSONObject) component.getAttributes().get("handlers");
    };
   
    public JSFunctionDefinition createEventFunction(FacesContext context, UIComponent component){
        Map<String,Object> params = new HashMap<String, Object>();
        params.put(getFieldId(component, SERIES_INDEX), new JSReference(SERIES_INDEX));
        params.put(getFieldId(component, POINT_INDEX), new JSReference(POINT_INDEX));
        params.put(getFieldId(component, X_VALUE), new JSReference(X_VALUE));
        params.put(getFieldId(component, Y_VALUE), new JSReference(Y_VALUE));
        params.put(getFieldId(component, EVENT_TYPE), new JSReference(EVENT_TYPE));
       
       
        AjaxFunction ajaxFce = AjaxRendererUtils.buildAjaxFunction(context, component);
        ajaxFce.getOptions().getParameters().putAll(params);
       
View Full Code Here

    }

    protected Object createSubmitEventFunction(FacesContext context, AbstractDashboard component) {
        ScriptString jsFunction;
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(getFieldId(context, component, START_X_PARAM), new JSReference(START_X_PARAM));
        params.put(getFieldId(context, component, START_Y_PARAM), new JSReference(START_Y_PARAM));
        params.put(getFieldId(context, component, END_X_PARAM), new JSReference(END_X_PARAM));
        params.put(getFieldId(context, component, END_Y_PARAM), new JSReference(END_Y_PARAM));
        params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new JSReference(EVENT_TYPE_PARAM));
        String clientId = component.getClientId();
        params.put(clientId, clientId);
        if (isAjaxMode(component)) {
            AjaxFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(context, component);
            ajaxFunction.getOptions().getParameters().putAll(params);
View Full Code Here

    protected Object createSubmitEventFunction(FacesContext context, AbstractVisualsearch component)
    {
        ScriptString jsFunction;
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(getFieldId(context, component, FACET_PARAM), new JSReference(FACET_PARAM));
        params.put(getFieldId(context, component, SEARCH_TERM_PARAM), new JSReference(SEARCH_TERM_PARAM));
        params.put(getFieldId(context, component, QUERY_PARAM), new JSReference(QUERY_PARAM));
        params.put(getFieldId(context, component, QUERY_JSON_PARAM), new JSReference(QUERY_JSON_PARAM));
        params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new JSReference(EVENT_TYPE_PARAM));
        String clientId = component.getClientId();
        params.put(clientId, clientId);
        if (isAjaxMode(component)) {
            AjaxFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(context, component);
            ajaxFunction.getOptions().getParameters().putAll(params);
            ajaxFunction.getOptions().set("complete", new JSReference(CALLBACK));
            jsFunction = ajaxFunction;
        } else {
            return null;
        }
        return new JSFunctionDefinition("event", EVENT_TYPE_PARAM, QUERY_PARAM, QUERY_JSON_PARAM, FACET_PARAM, SEARCH_TERM_PARAM, CALLBACK).addToBody(
View Full Code Here

    }

    protected Object createSubmitEventFunction(FacesContext context, AbstractSchedule component) {
        ScriptString jsFunction;
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(getFieldId(context, component, START_DATE_PARAM), new JSReference(START_DATE_PARAM));
        params.put(getFieldId(context, component, END_DATE_PARAM), new JSReference(END_DATE_PARAM));
        params.put(getFieldId(context, component, ITEM_ID_PARAM), new JSReference(ITEM_ID_PARAM));
        params.put(getFieldId(context, component, DAY_DELTA_PARAM), new JSReference(DAY_DELTA_PARAM));
        params.put(getFieldId(context, component, MINUTE_DELTA_PARAM), new JSReference(MINUTE_DELTA_PARAM));
        params.put(getFieldId(context, component, ALL_DAY_PARAM), new JSReference(ALL_DAY_PARAM));
        params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new JSReference(EVENT_TYPE_PARAM));
        params.put(getFieldId(context, component, VIEW_PARAM), new JSReference(VIEW_PARAM));
        String clientId = component.getClientId();
        params.put(clientId, clientId);
        if (isAjaxMode(component)) {
            AjaxFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(context, component);
            ajaxFunction.getOptions().getParameters().putAll(params);
            ajaxFunction.getOptions().set("complete", new JSReference(CALLBACK));
            jsFunction = ajaxFunction;
        } else if (SwitchType.server.equals(component.getSwitchType())) {
            jsFunction = new JSFunction("RichFaces.submitForm", "#"
                + RendererUtils.getInstance().getNestingForm(component).getClientId(context),
                params,
View Full Code Here

TOP

Related Classes of org.richfaces.javascript.JSReference

Copyright © 2018 www.massapicom. 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.