@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(Slider.this.input.getMarkupId()).append("').on('change', function() { "); statements.append("jQuery('#").append(Slider.this.label.getMarkupId()).append("').slider('value', jQuery(this).val()); "); //change the slider value (+slide) statements.append("} );"); return String.format("jQuery(function() { %s });", statements); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(lower.getMarkupId()).append("').on('change', function() { "); statements.append("jQuery('#").append(label.getMarkupId()).append("').slider('values', 0, jQuery(this).val()); "); //change the slider value (+slide) statements.append("} );"); return String.format("jQuery(function() { %s });", statements); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(upper.getMarkupId()).append("').on('change', function() { "); statements.append(" jQuery('#").append(label.getMarkupId()).append("').slider('values', 1, jQuery(this).val()); "); // change the slider value (+slide) statements.append("});"); return statements.toString(); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(upper.getMarkupId()).append("').on('change', function() { "); statements.append("jQuery('#").append(label.getMarkupId()).append("').slider('values', 1, jQuery(this).val()); "); //change the slider value (+slide) statements.append("} );"); return String.format("jQuery(function() { %s });", statements); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(Slider.this.input.getMarkupId()).append("').on('change', function() { "); statements.append(" jQuery('#").append(Slider.this.label.getMarkupId()).append("').slider('value', jQuery(this).val()); "); //change the slider value (+slide) statements.append("});"); return statements.toString(); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(lower.getMarkupId()).append("').on('change', function() { "); statements.append(" jQuery('#").append(label.getMarkupId()).append("').slider('values', 0, jQuery(this).val()); "); // change the slider value (+slide) statements.append("});"); return statements.toString(); } };
@Override public void onConfigure(JQueryBehavior behavior) { super.onConfigure(behavior); StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(this.lower.getMarkupId()).append("').val(ui.values[0]); "); statements.append("jQuery('#").append(this.upper.getMarkupId()).append("').val(ui.values[1]); "); if (!Strings.isEmpty(super.labelId)) { statements.append("jQuery('#").append(super.labelId).append("').text(").append(this.getLabelPattern()).append("); "); } behavior.setOption("slide", String.format("function(event, ui) { %s }", statements)); behavior.setOption("values", this.getModelObject()); }
@Override protected void onConfigure(JQueryBehavior behavior) { super.onConfigure(behavior); StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(this.input.getMarkupId()).append("').val(ui.value); "); if (super.labelId != null) { statements.append("jQuery('#").append(super.labelId).append("').text(").append(this.getLabelPattern()).append("); "); } behavior.setOption("slide", String.format("function(event, ui) { %s }", statements)); behavior.setOption("value", this.getModelObject()); }
@Override protected void onConfigure(JQueryBehavior behavior) { super.onConfigure(behavior); StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(this.lower.getMarkupId()).append("').val(ui.values[0]); "); statements.append("jQuery('#").append(this.upper.getMarkupId()).append("').val(ui.values[1]); "); if (!Strings.isEmpty(super.labelId)) { statements.append("jQuery('#").append(super.labelId).append("').text(").append(this.getLabelPattern()).append("); "); } behavior.setOption("slide", String.format("function(event, ui) { %s }", statements)); behavior.setOption("values", this.getModelObject()); }
@Override public void onConfigure(JQueryBehavior behavior) { super.onConfigure(behavior); StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(this.input.getMarkupId()).append("').val(ui.value); "); if (super.labelId != null) { statements.append("jQuery('#").append(super.labelId).append("').text(").append(this.getLabelPattern()).append("); "); } behavior.setOption("slide", String.format("function(event, ui) { %s }", statements)); behavior.setOption("value", this.getModelObject()); }
@Override protected void onInitialize() { super.onInitialize(); // Ensure proper order of the initializing JS header items: first combo box // behavior (in super.onInitialize()), then tooltip. Options options = new Options(DescriptionTooltipBehavior.makeTooltipOptions()); options.set("content", ClassicKendoComboboxTextFeatureEditor.FUNCTION_FOR_TOOLTIP); add(new TooltipBehavior("#" + field.getMarkupId() + "_listbox *[title]", options) { private static final long serialVersionUID = -7207021885475073279L; @Override protected String $() { // REC: It takes a moment for the KendoDatasource to load the data and // for the Combobox to render the hidden dropdown. I did not find // a way to hook into this process and to get notified when the // data is available in the dropdown, so trying to handle this // with a slight delay hopeing that all is set up after 1 second. return "try {setTimeout(function () { " + super.$() + " }, 1000); } catch (err) {}; "; } }); }
@Override protected void onInitialize() { super.onInitialize(); // Ensure proper order of the initializing JS header items: first combo box // behavior (in super.onInitialize()), then tooltip. Options options = new Options(DescriptionTooltipBehavior.makeTooltipOptions()); options.set("content", ClassicKendoComboboxTextFeatureEditor.FUNCTION_FOR_TOOLTIP); add(new TooltipBehavior("#" + field.getMarkupId() + "_listbox *[title]", options) { private static final long serialVersionUID = -7207021885475073279L; @Override protected String $() { // REC: It takes a moment for the KendoDatasource to load the data and // for the Combobox to render the hidden dropdown. I did not find // a way to hook into this process and to get notified when the // data is available in the dropdown, so trying to handle this // with a slight delay hopeing that all is set up after 1 second. return "try {setTimeout(function () { " + super.$() + " }, 1000); } catch (err) {}; "; } }); }