@Override public final CharSequence getCallbackUrl() { return super.getCallbackUrl() + "&" + HISTORY_ITEM_PARAM + "=' + HistoryManager.getHistoryItem()"; }
@Override public final CharSequence getCallbackUrl() { return super.getCallbackUrl() + PLACEHOLDER; }
@Override public final CharSequence getCallbackUrl() { return super.getCallbackUrl() + PLACEHOLDER; }
@Override public final CharSequence getCallbackUrl(final boolean onlyTargetActivePage) { return super.getCallbackUrl(onlyTargetActivePage) + "&"+ HISTORY_ITEM_PARAM +"=' + HistoryManager.getHistoryItem()"; }
/** * Add the x&y coordinates to the callback url by concatenating them. The endresults should be something like * var wcall=Wicket.Ajax.get('?wicket:interface:etc:etc:etc&mouseX=' + x + '&mosueY= ' + y + ''); * The end single quote is needed because the result of this method is escaped with single quotes, * resulting in the somewhat ugly + '' */ @Override public CharSequence getCallbackUrl(boolean onlyTargetActivePage) { String url = super.getCallbackUrl(onlyTargetActivePage).toString(); url += "&" + MOUSE_X_PARAM + "=' + x + '&" + MOUSE_Y_PARAM + "=' + y + '"; return url; }
/** * Add the x&y coordinates to the callback url by concatenating them. The endresults should be something like * var wcall=Wicket.Ajax.get('?wicket:interface:etc:etc:etc&mouseX=' + x + '&mosueY= ' + y + ''); * The end single quote is needed because the result of this method is escaped with single quotes, * resulting in the somewhat ugly + '' */ @Override public CharSequence getCallbackUrl(boolean onlyTargetActivePage) { String url = super.getCallbackUrl(onlyTargetActivePage).toString(); url += "&" + MOUSE_X_PARAM + "=' + x + '&" + MOUSE_Y_PARAM + "=' + y + '"; return url; }
/** * @return javascript that will generate an ajax GET request to this behavior * * @param onlyTargetActivePage * if true the callback to this behavior will be ignore if the page is not the last * one the user accessed * */ protected CharSequence getCallbackScript(boolean onlyTargetActivePage) { return generateCallbackScript("wicketAjaxGet('" + getCallbackUrl(onlyTargetActivePage) + "'"); }
/** * @return javascript that will generate an ajax GET request to this behavior * * @param onlyTargetActivePage * if true the callback to this behavior will be ignore if the page is not the last * one the user accessed * */ protected CharSequence getCallbackScript(boolean onlyTargetActivePage) { return generateCallbackScript("wicketAjaxGet('" + getCallbackUrl(onlyTargetActivePage) + "'"); }
protected String subscribeEventCallback(String jsEvent) { return getYuiPanelVar() + ".subscribe(\"hide\", function(type, args) { " + "wicketAjaxGet('" + ajaxBehavior.getCallbackUrl(true) + "&" + EVENT_TYPE + "='+type);" + " } );\n"; }
@Override public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); response.render(OnDomReadyHeaderItem.forScript("InfiniteScroll.getFromContainer('"+getMarkupId()+"').setUrls('"+upBehavior.getCallbackUrl()+"', '"+downBehavior.getCallbackUrl()+"')")); }
@Override protected void onBeforeRender() { // Obtain callback urls used for uploading files & notification final String uploadUrl = urlFor(ajaxFileUploadBehavior, IBehaviorListener.INTERFACE, new PageParameters()).toString(); settings.setUploadUrl(uploadUrl); final String uploadDoneNotificationUrl = ajaxCallbackUploadDoneBehavior.getCallbackUrl().toString(); settings.setUploadDoneNotificationUrl(uploadDoneNotificationUrl); final String selectionChangeNotificationUrl = ajaxCallbackSelectionChangeBehavior.getCallbackUrl().toString(); settings.setSelectionChangeNotificationUrl(selectionChangeNotificationUrl); super.onBeforeRender(); }
private String generateInitJS() { return "\n $(function () { " + "\n window.AbstractFormPage.setup(" + new JSONObject() .put("callbackUrl", saveFormAjaxBehavior.getCallbackUrl().toString()) .toString(2) + "); " + "\n });"; }
@Override public void renderHead(final IHeaderResponse response) { super.renderHead(response); response.render(OnDomReadyHeaderItem.forScript("$('#" + this.getMarkupId() + "').data('callback', '" + deleteBehavior.getCallbackUrl() + "');")); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); try (PackageTextTemplate packageTextTemplate = new PackageTextTemplate(getClass(), "RichTextNewTabPage.js")) { final Map<String, String> params = new HashMap<>(); /*If don't contains the View, i add a view with empty buttons, for default use.*/ if (!viewSupplier.optional().isPresent()) { viewSupplier = (ISupplier<SViewByRichTextNewTab>) SViewByRichTextNewTab::new; getLogger().info("SViewByRichTextNewTab was insert in the RichTextNewTabPage."); } params.put("submitButtonId", submitButton.getMarkupId()); params.put("classDisableDoubleClick", viewSupplier.get() .getConfiguration() .getDoubleClickDisabledClasses() .stream() .reduce(new StringBuilder(), (s, b) -> s.append(b).append(", "), StringBuilder::append).toString()); params.put("hiddenInput", this.hiddenInput.getMarkupId()); params.put("showSaveButton", String.valueOf(this.viewSupplier.get().isShowSaveButton())); params.put("htmlContainer", this.markupId); params.put("callbackUrl", eventSaveCallbackBehavior.getCallbackUrl().toString()); params.put("isEnabled", String.valueOf(!readOnly)); params.put("buttonsList", this.renderButtonsList()); packageTextTemplate.interpolate(params); response.render(JavaScriptHeaderItem.forScript(packageTextTemplate.getString(), this.getId())); } catch (IOException e) { getLogger().error(e.getMessage(), e); } RecursosStaticosSingularTemplate.getStyles("singular").forEach(response::render); RecursosStaticosSingularTemplate.getJavaScriptsUrls().forEach(response::render); }
@Override public void renderHead(IHeaderResponse aResponse) { // BRAT call to load the BRAT JSON from our collProvider and docProvider. String[] script = new String[] { "Util.embedByURL(", " '"+vis.getMarkupId()+"',", " '"+collProvider.getCallbackUrl()+"', ", " '"+docProvider.getCallbackUrl()+"', ", " function(dispatcher) {", "dispatcher.post('clearSVG', []);", " dispatcher.ajaxUrl = '" + controller.getCallbackUrl() + "'; ", " dispatcher.wicketId = '" + vis.getMarkupId() + "'; ", " var ajax = new Ajax(dispatcher);", " var ajax_"+vis.getMarkupId()+" = ajax;", " var curation_mod = new CurationMod(dispatcher, '"+vis.getMarkupId()+"');", " }", ");", }; // This doesn't work with head.js because the onLoad event is fired before all the // JavaScript references are loaded. aResponse.renderOnLoadJavaScript("\n"+StringUtils.join(script, "\n")); } @Override
protected void onBeforeRender() { super.onBeforeRender(); String lat = get(thetopic.getTopic().getTopicIF(), PSI.ON_LATITUDE); if (lat == null) lat = "59.92"; String lng = get(thetopic.getTopic().getTopicIF(), PSI.ON_LONGITUDE); if (lng == null) lng = "10.74"; // we can't call getCallbackUrl() in the constructor, but here it's // possible, so we insert the URI into the label we created above, // and everything is hunky dory. String js = "var ajaxurl = '" + behave.getCallbackUrl() + "';\n"; js += "var latitude = " + lat + ";\n"; js += "var longitude = " + lng + ";\n"; ajaxurllabel.modelChanging(); ajaxurlmodel.setObject(js); ajaxurllabel.modelChanged(); }
@Override protected void onBeforeRender() { super.onBeforeRender(); String lat = get(thetopic.getTopic().getTopicIF(), PSI.ON_LATITUDE); if (lat == null) lat = "59.92"; String lng = get(thetopic.getTopic().getTopicIF(), PSI.ON_LONGITUDE); if (lng == null) lng = "10.74"; // we can't call getCallbackUrl() in the constructor, but here it's // possible, so we insert the URI into the label we created above, // and everything is hunky dory. String js = "var ajaxurl = '" + behave.getCallbackUrl() + "';\n"; js += "var latitude = " + lat + ";\n"; js += "var longitude = " + lng + ";\n"; ajaxurllabel.modelChanging(); ajaxurlmodel.setObject(js); ajaxurllabel.modelChanged(); }
googleMapsPanel.add($b.onConfigure(c -> googleMapsPanel.enableMultipleMarkers(addPoint.getCallbackUrl().toString(), pointsCtx.getContainer().getMarkupId())));
private String generateInitJS() { if (viewMode.isEdition()) { return "" //@formatter:off + "\n $(function () { " + "\n window.FileUploadPanel.setup(" + new JSONObject() .put("param_name", PARAM_NAME) .put("panel_id", self.getMarkupId()) .put("file_field_id", fileField.getMarkupId()) .put("files_id", filesContainer.getMarkupId()) .put("progress_bar_id", progressBar.getMarkupId()) .put("upload_url", getUploadUrl()) .put("download_url", getDownloaderUrl()) .put("add_url", getAdderUrl()) .put("max_file_size", getMaxFileSize()) .put("allowed_file_types", getAllowedFileTypes()) .put("preview_update_callback", previewCallBack.getCallbackUrl()) .put("allowed_file_extensions", getAllowedExtensions()) .toString(2) + "); " + "\n });"; //@formatter:on } else { return ""; } }
+ " function(dispatcher) {" + " dispatcher.wicketId = '" + vis.getMarkupId() + "'; " + " dispatcher.ajaxUrl = '" + controller.getCallbackUrl() + "'; " + " var ajax = new Ajax(dispatcher);" + " var curation_mod = new CurationMod(dispatcher, '" + vis.getMarkupId() + "');"