@Override protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) { Application.getBean(FieldLanguagesValuesDao.class) .delete(getModelObject(), WebSession.getUserId()); target.add(panel.listContainer); target.appendJavaScript("labelsInit();"); }
private static void replace(AjaxRequestTarget target, Component component) { component.add(new DisplayNoneBehavior()); target.prependJavaScript( "notify|jQuery('#" + component.getMarkupId() + "').slideUp(1000, notify);"); target.add(component); target.appendJavaScript("jQuery('#" + component.getMarkupId() + "').slideDown(1000);"); }
public void iniciar(AjaxRequestTarget target) { String url = getCallbackUrl().toString(); if (antiCache) { url = url + (url.contains("?") ? "&" : "?"); url = url + "antiCache=" + System.currentTimeMillis(); } target.appendJavaScript("setTimeout(\"window.location.href='" + url + "'\", 100);"); }
@Override protected void onNewSubmit(AjaxRequestTarget target, Form<?> f) { Fieldlanguagesvalues flv = new Fieldlanguagesvalues(); flv.setLanguage_id(panel.language.getLanguage_id()); this.setModelObject(flv); target.add(this); target.appendJavaScript("labelsInit();"); }
public void cancelEditing(AjaxRequestTarget target) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.cancelEditing(); }")); }
/** * Sets the dialog's title dynamically * * @param target the {@link AjaxRequestTarget} * @param title the dialog's title */ public void setTitle(AjaxRequestTarget target, IModel<String> title) { this.setTitle(title); target.appendJavaScript( this.widgetBehavior.$( Options.asString("option"), Options.asString("title"), Options.asString(title.getObject()))); }
public void clearSelection(AjaxRequestTarget target) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.clearSelection(); }")); }
public void saveChanges(AjaxRequestTarget target) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.saveChanges(); }")); }
public void pageSize(AjaxRequestTarget target, Integer pageSize) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.pageSize(" + pageSize + "); }")); }
public void filter(AjaxRequestTarget target, DataSourceOptions.FilterOption filter) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.filter(" + hashToJson(filter.toHashMap()) + "); }")); }
public void setEnabled(AjaxRequestTarget target, Boolean enabled) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.enabled(" + (enabled ? "true" : "false") + "); }")); }
public void addRow(AjaxRequestTarget target, HashMap<String, Object> item) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.addRow(" + hashToJson(item) + "); }")); }
public void collapseRow(AjaxRequestTarget target, JsonFunction row) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.collapseRow(" + row + "); }")); }
public void select(AjaxRequestTarget target, String selector) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.select(" + selector + "); }")); }
public void collapseRow(AjaxRequestTarget target, Integer index) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.collapseRow(" + index + "); }")); }
@Override protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) { Fieldlanguagesvalues flv = getModelObject(); Fieldvalues fv = flv.getFieldvalues(); Application.getBean(FieldValueDao.class).update(fv, WebSession.getUserId()); flv.setFieldvalues(fv); Application.getBean(FieldLanguagesValuesDao.class).update(flv, WebSession.getUserId()); hideNewRecord(); target.add(panel.listContainer); target.appendJavaScript("labelsInit();"); }
public void editCell(AjaxRequestTarget target, Integer rowIndex, Integer colIndex) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.editCell(" + rowIndex + ", " + colIndex + "); }")); }
public void reorderColumn(AjaxRequestTarget target, Integer oldIndex, Integer newIndex) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.reorderColumn(" + oldIndex + ", " + newIndex + "); }")); }
@Override protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) { Fieldlanguagesvalues flv = getModelObject(); if (flv.getFieldlanguagesvalues_id() != null) { flv = Application.getBean(FieldLanguagesValuesDao.class) .get(getModelObject().getFieldlanguagesvalues_id()); } else { flv = new Fieldlanguagesvalues(); } this.setModelObject(flv); target.add(this); target.appendJavaScript("labelsInit();"); }
public void sort(AjaxRequestTarget target, String field, Boolean desc, Boolean unsort) { target.appendJavaScript( jsClosure( "var sw = $('#" + getMarkupId() + "').swidget(\"" + getWidgetType() + "\"); if (sw) { sw.sort(\"" + field + "\", " + (desc ? "true" : "false") + "," + (unsort ? "true" : "false") + ")); }")); }
/** * helper method * * @param marker */ public void clickAndOpenPopup(Marker marker, AjaxRequestTarget target) { String mapId = getOpenLayerMap().getJSInstance(); String jsToRun = "if (" + mapId + ".popup != null) {" + " " + mapId + ".map.removePopup(" + mapId + ".popup);" + " " + mapId + ".popup.destroy();" + " " + mapId + ".popup = null;" + "}"; target.prependJavaScript(jsToRun); // Currently only support clicking on markers! getOpenLayerMap().getInfoWindow().getContent().replaceWith(marker.getPopup()); getOpenLayerMap().getInfoWindow().setContent(marker.getPopup()); target.add(marker.getPopup()); jsToRun = mapId + ".popup = new OpenLayers.Popup('map', " + new LonLat(marker.getLonLat().getLng(), marker.getLonLat().getLat()) + ", " + new Size(195, 250).getJSconstructor() + ", document.getElementById(" + mapId + ".popupId).innerHTML, true);" + mapId + ".popup.setBackgroundColor('white');" + mapId + ".map.addPopup(" + mapId + ".popup);"; // open info window target.appendJavaScript(jsToRun); }
/** * close the popup * * @param target */ public void closePopup(AjaxRequestTarget target) { String mapId = getOpenLayerMap().getJSInstance(); String jsToRun = "if (" + mapId + ".popup != null) {" + " " + mapId + ".map.removePopup(" + mapId + ".popup);" + " " + mapId + ".popup.destroy();" + " " + mapId + ".popup = null;" + "}"; target.appendJavaScript(jsToRun); }
@Override protected void respond(AjaxRequestTarget pTarget) { ImageUploadContentPanel content = new ImageUploadContentPanel(modalWindow.getContentId(), uploadFolderPath) { private static final long serialVersionUID = 1L; @Override public void onImageUploaded( ImageFileDescription pImageFileDescription, AjaxRequestTarget pTarget) { modalWindow.close(pTarget); resetModalContent(); CharSequence url = ImageUploadPanel.this.urlFor(IResourceListener.INTERFACE, null); XmlTag xmlImageTag = ImageUploadHelper.createImageTag(pImageFileDescription, url); pTarget.appendJavaScript("putImage('" + xmlImageTag.toString() + "');"); } }; modalWindow.setContent(content); // Remember cursor position - it's needed for IE pTarget.appendJavaScript("saveBookmark();"); modalWindow.show(pTarget); }
/** * Method to enable the progressBar within the ajax request * * @param ajaxRequestTarget */ public void enable(AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(this.enable().render().toString()); }
/** * Method to move to top the dialog within the ajax request * * @param ajaxRequestTarget */ public void moveToTop(AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(this.moveToTop().render().toString()); }
/** * Method to decrement the value of the progressBar within the ajax request * * @param ajaxRequestTarget * @param decrement The decrement to add to the current value */ public void decrement(AjaxRequestTarget ajaxRequestTarget, int decrement) { ajaxRequestTarget.appendJavaScript(this.decrement(decrement).render().toString()); }
/** * Method to increment the value of the progressBar within the ajax request * * @param ajaxRequestTarget */ public void increment(AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(this.increment().render().toString()); }
/** * Method to returns the .ui-progressbar element within the ajax request * * @param ajaxRequestTarget */ public void widget(AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(this.widget().render().toString()); }
/** * Method to set the current value of the progressBar within the ajax request * * @param ajaxRequestTarget * @param value */ public void value(AjaxRequestTarget ajaxRequestTarget, int value) { ajaxRequestTarget.appendJavaScript(this.value(value).render().toString()); }
/** * Method to destroy the progressBar within the ajax request * * @param ajaxRequestTarget */ public void destroy(AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(this.destroy().render().toString()); }