Package de.agilecoders.wicket.jquery

Examples of de.agilecoders.wicket.jquery.JQuery


     * creates the initializer script.
     *
     * @return initializer script
     */
    protected String createScript(final ColorPickerConfig config) {
        JQuery script = $(this);

        if (config.isComponent()) {
            script.closest(".colorpicker-component");
        }
        script.chain("colorpicker", config);

        if (config.isAjaxUpdate()) {

            List<ColorChangeAjaxBehavior> behaviors = getBehaviors(ColorChangeAjaxBehavior.class);
            ColorChangeAjaxBehavior colorChangeAjaxBehavior = behaviors.get(0);
            String toColor = config.getFormat().to();

            CharSequence attrs = colorChangeAjaxBehavior.getAttrs();
            script.on("changeColor", new JQuery.JavaScriptInlineFunction(
                    String.format("var color = evt.color.%s; new Wicket.Ajax.Call().ajax(%s)",
                                  toColor, attrs)));
        }

        return script.get();
    }
View Full Code Here


                    .append(String.format("var %s = new Bloodhound(%s);", bh.getName(), bhParams));
                builder.append(String.format("%s.initialize();", bh.getName()));
            }
        }

        JQuery functionCall = $(this).chain("typeahead", config, config.getDatasets());
        builder.append(functionCall.get());

        if (selectBehavior != null) {

            CharSequence function = selectBehavior.getCallbackFunction(
                CallbackParameter.context("object"),
View Full Code Here

    @Override
    public void renderHead(final IHeaderResponse response) {
        FileinputJsReference.INSTANCE.renderHead(response);

        JQuery fileinputJS = $(this).chain("fileinput", config);

        String ajaxUpload = "";
        if (ajaxUploadBehavior != null) {
            PackageTextTemplate tmpl = new PackageTextTemplate(BootstrapFileInputField.class, "res/fileinput.tmpl.js");
            Map<String, Object> variables = new HashMap<String, Object>();
            variables.put("markupId", Strings2.getMarkupId(this));
            for (String label : LABELS) {
                variables.put(label, getString(label));
            }
            variables.put("eventName", ajaxUploadBehavior.getEvent());

            ajaxUpload = tmpl.asString(variables);
        }

        response.render(OnDomReadyHeaderItem.forScript(fileinputJS.get() + ajaxUpload));
    }
View Full Code Here

    /**
     * @return new initializer script
     */
    protected String newInitializerScript() {
        JQuery jQuery = $(this, ".dropdown-toggle");

        return jQuery.chain(dropdown()).get();
    }
View Full Code Here

TOP

Related Classes of de.agilecoders.wicket.jquery.JQuery

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.