/** * Hide the modal. Just sends the javascript to close the modal * * @param target the AjaxRequestTarget */ public void hide(AjaxRequestTarget target){ target.prependJavaScript("$('#"+getMarkupId()+"').modal('hide');"); }
@Override public void onClick(AjaxRequestTarget target) { String callbackScript = autoCompletingBehaviour.getCallbackScript().toString(); target.prependJavaScript(callbackScript); }
@Override protected final void respond(AjaxRequestTarget target) { boolean result = onEvent(target); target.prependJavaScript(String.format("$.data(document, '%s', %s);", uuid, String.valueOf(result))); }
@Override protected final void respond(AjaxRequestTarget target) { boolean result = onEvent(target); target.prependJavaScript(String.format("$.data(document, '%s', %s);", uuid, String.valueOf(result))); }
@Override public void ajaxDeleteWidget(AbstractWidget<?> widget, AjaxRequestTarget target) { target.prependJavaScript("$('#"+widget.getMarkupId()+"').remove();"); }
public void reload() { channels = null; AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class); if (target != null) { target.prependJavaScript("Ext.StoreMgr.lookup('" + this.storeId + "').reload();"); } }
private void saveInput(AjaxRequestTarget target, List<CollectionInputPanel<T>> components) { List<String> ids = Lists.newArrayList(); for (CollectionInputPanel<T> panel : components) { ids.addAll(panel.getInputIds()); } target.prependJavaScript(String.format("saveInput('%s', %s);", parent.getContainerId(), new JSONArray(ids).toString())); }
@Override protected void respond(AjaxRequestTarget target) { target.prependJavaScript(String.format("" + "var $button = $('#%s');" + "if ($button.length != 0) {" + "$button.removeAttr('disabled');" + "$button.val($button[0].prevValue);" + "$button.html($button[0].prevHtml);" + "}", getComponent().getMarkupId())); runTask(target); }
@Override protected void onRemove() { super.onRemove(); AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class).orElse(null); if (target != null) { // ensure the select2 is closed so we do not leave an orphaned dropdown component in the dom target.prependJavaScript(String.format("$('#%s').select2('close');", getJquerySafeMarkupId())); } } }
@Override protected void onRemove() { super.onRemove(); AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class).orElse(null); if (target != null) { // ensure the select2 is closed so we do not leave an orphaned dropdown component in the dom target.prependJavaScript(String.format("$('#%s').select2('close');", getJquerySafeMarkupId())); } } }
@Override public void ajaxDeleteWidget(AbstractWidget<?> widget, AjaxRequestTarget target) { DashboardPanel<?> dashboard = widget.getDashboardPanel(); target.prependJavaScript("var gridster = $('#"+dashboard.getMarkupId()+" > ul').data('gridster');\n" + "gridster.remove_widget($('#"+widget.getMarkupId()+"'));\n" + "gridster.gridsterChanged();"); }
@Override protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) { position.deleteKostZuweisung(zuweisung.getIndex()); final StringBuffer prependJavascriptBuf = new StringBuffer(); prependJavascriptBuf.append(WicketAjaxUtils.removeChild("costAssignmentBody", row.getMarkupId())); ajaxComponents.remove(row); rows.remove(row); target.prependJavaScript(prependJavascriptBuf.toString()); }
public void hide(AjaxRequestTarget target) { // limpo os valores, pois erros de validacao impedem o formulario de se ser recarregado clearInputs(); this.setVisible(false); if (target != null) { final String blockingFunction = "hide_hidden_wicket_modal"; target.prependJavaScript(blockingFunction + "|" + getHideJavaScriptCallback(blockingFunction)); target.add(this); } }
@Override public void ajaxAddWidget(AbstractWidget<?> widget, AjaxRequestTarget target) { DashboardPanel<?> dashboard = widget.getDashboardPanel(); target.prependJavaScript("$('#"+dashboard.getMarkupId()+" > ul').append('<li id=\\'"+widget.getMarkupId()+"\\'></li>')"); target.add(widget); }
@Override public void onEvent(IEvent<?> event) { super.onEvent(event); if (event.getPayload() instanceof AjaxRequestTarget) { AjaxRequestTarget target = (AjaxRequestTarget) event.getPayload(); if (target.getComponents().contains(this)) { // if this component is being repainted by ajax, directly, we must destroy Select2 so it removes // its elements from DOM target.prependJavaScript(JQuery.execute("$('#%s').select2('destroy');", getJquerySafeMarkupId())); } } }
@Override public void onEvent(IEvent<?> event) { super.onEvent(event); if (event.getPayload() instanceof AjaxRequestTarget) { AjaxRequestTarget target = (AjaxRequestTarget) event.getPayload(); if (target.getComponents().contains(this)) { // if this component is being repainted by ajax, directly, we must destroy Select2 so it removes // its elements from DOM target.prependJavaScript(JQuery.execute("$('#%s').select2('destroy');", getJquerySafeMarkupId())); } } }
public ModalPanel(AjaxRequestTarget target) { super(((BasePage)target.getPage()).getRootComponents().newChildId()); BasePage page = (BasePage) target.getPage(); page.getRootComponents().add(this); target.prependJavaScript(String.format("$('body').append(\"<div id='%s'></div>\");", getMarkupId())); target.add(this); }
@Override protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) { final KostZuweisungDO zuweisung = addZuweisung(position); final WebMarkupContainer newRow = createRow(rows.newChildId(), position, zuweisung); newRow.setOutputMarkupId(true); final String prependJavascript = WicketAjaxUtils.appendChild("costAssignmentBody", "tr", newRow.getMarkupId()); rows.add(newRow); target.add(newRow); ajaxComponents.addTargetComponents(target); target.prependJavaScript(prependJavascript); }
@Override public void ajaxAddWidget(AbstractWidget<?> widget, AjaxRequestTarget target) { DashboardPanel<?> dashboard = widget.getDashboardPanel(); target.prependJavaScript("$('#"+dashboard.getMarkupId()+" > ul').append('<li id=\\'"+widget.getMarkupId()+"\\'></li>')"); target.add(widget); target.appendJavaScript("var gridster = $('#"+dashboard.getMarkupId()+" > ul').data('gridster');\n" + "gridster.add_widget($('#"+widget.getMarkupId()+"'));\n" + "gridster.gridsterChanged();"); }
public void refresh(AjaxRequestTarget target) { target.add(get("items")); target.add(get("title")); target.add(get("listIndices")); target.add(get("moveDownLink")); target.add(get("moveUpLink")); target.add(get("initScript")); target.prependJavaScript("LinksColumn.hideCurrent();"); }