Examples of JsScript


Examples of org.apache.click.element.JsScript

     */
    protected void addCalendarOptions(List headElements) {
        String fieldId = getId();
        String imgId = fieldId + "-button";

        JsScript script = new JsScript();
        script.setId(fieldId + "_js_setup");

        // Note the Calendar options script is recreated and checked if it
        // is contained in the headElement. This caters for when the field is
        // used in a fly-weight pattern such as FormTable.
        if (!headElements.contains(script)) {

            // Script must be executed as soon as browser dom is ready
            script.setExecuteOnDomReady(true);

            HtmlStringBuffer buffer = new HtmlStringBuffer(150);

            buffer.append("Event.observe('").append(imgId).append("', 'click', function(){");
            buffer.append(" Date.first_day_of_week=").append(getFirstDayOfWeek() - 1).append(";");
            buffer.append(" calendar = new CalendarDateSelect($('").append(fieldId).append("'), {");
            buffer.append("  minute_interval: 1, popup_by: '").append(imgId).append("',");
            buffer.append("  embedded: false,");
            buffer.append("  footer: false,");
            buffer.append("  buttons: ").append(isShowTime()).append(",");
            buffer.append("  time: ").append(isShowTime() ? "'mixed'," : "false,");
            buffer.append("  formatValue: '").append(getCalendarPattern()).append("',");
            buffer.append("  year_range: [").append(getMinimumYear()).append(",").append(getMaximumYear()).append("]");
            buffer.append(" });");
            buffer.append("});");

            script.setContent(buffer.toString());
            headElements.add(script);
        }
    }
View Full Code Here

Examples of org.apache.click.element.JsScript

            Map model = ClickUtils.createTemplateModel(this, getContext());
            model.put("pageSize", pageSize);

            // Note the actual JavaScript necessary to setup the dynamic scrolling
            // is specified in the Page JavaScript template: ajax-live-scroller.js.
            headElements.add(new JsScript("/ajax/ajax-live-scroller.js", model));
        }
        return headElements;
    }
View Full Code Here

Examples of org.apache.click.element.JsScript

            // Add the ID of a target element in the Page template to replace
            // with new data, in this example the target is 'customerDetails'
            model.put("target", "customerDetails");

            // Include the Page associated JavaScript template
            headElements.add(new JsScript("/ajax/ajax-select.js", model));
        }

        return headElements;
    }
View Full Code Here

Examples of org.apache.click.element.JsScript

            headElements.add(new JsImport("/assets/js/jquery.tools.min.js"));
            headElements.add(new CssImport("/assets/css/tabs-accordion.css"));

            // Note the actual JavaScript necessary to setup the accordion is
            // specified in the Page JavaScript template -> ajax-accordion.js.
            headElements.add(new JsScript("/ajax/ajax-accordion.js", new HashMap()));

            // Alternatively, the JsScript below could be used to add
            // the necessary JavaScript to setup the accordion, for example:
            /* String content =
                "$(document).ready(function() {"
View Full Code Here

Examples of org.apache.click.element.JsScript

            model.put("cityId", city.getId());
            model.put("suburbId", suburb.getId());

            // populate-on-select.js is a Velocity template which is rendered directly
            // from this Page
            JsScript script = new JsScript("/form/dynamic/populate-on-select.js", model);
            headElements.add(script);
        }
        return headElements;
    }
View Full Code Here

Examples of org.apache.click.element.JsScript

        if (headElements == null) {
            headElements = super.getHeadElements();
            headElements.add(new JsImport("/assets/js/jquery-1.3.2.js"));

            Map jsModel = new HashMap();
            headElements.add(new JsScript("/control/disabled-demo.js", jsModel));
        }
        return headElements;
    }
View Full Code Here

Examples of org.apache.click.element.JsScript

        if (headElements == null) {
            headElements = super.getHeadElements();

            headElements.add(new CssImport("/assets/css/imports.css"));
            headElements.add(new JsImport("/assets/js/imports.js"));
            headElements.add(new JsScript("addLoadEvent(function() { initMenu(); });"));
        }
        return headElements;
    }
View Full Code Here

Examples of org.apache.click.element.JsScript

            headElements.add(new JsImport("/yui/element/element-beta-min.js"));
            headElements.add(new JsImport("/yui/container/container_core-min.js"));
            headElements.add(new JsImport("/yui/editor/simpleeditor-min.js"));
        }

        JsScript script = new JsScript();
        script.setId(getId() + "_js_setup");

        if (!headElements.contains(script)) {
            script.setExecuteOnDomReady(true);

            HtmlStringBuffer buffer = new HtmlStringBuffer();
            buffer.append("var myConfig = {").append(getConfig()).append("};\n");
            buffer.append("var myEditor = new YAHOO.widget.SimpleEditor('");
            buffer.append(getId()).append("', myConfig);\n");
            buffer.append("if(myConfig.titlebar) {");
            buffer.append(" myEditor._defaultToolbar.titlebar=myConfig.titlebar; }\n");
            buffer.append("myEditor.render();\n");
            script.setContent(buffer.toString());
            headElements.add(script);
        }

        return headElements;
    }
View Full Code Here

Examples of org.apache.click.element.JsScript

            jsModel.put("linkId", '#' + link.getId());

            String content =
                context.renderTemplate("/general/page-head-demo.js", jsModel);

            headElements.add(new JsScript(content));
        }
        return headElements;
    }
View Full Code Here

Examples of org.apache.click.element.JsScript

            // Add the ID of a target element in the Page template to replace
            // with new data, in this example the target is 'customerDetails'
            model.put("target", "customerDetails");

            // Include the ajax-select.js template
            headElements.add(new JsScript("/ajax/ajax-select.js", model));
        }

        return headElements;
    }
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.