/** * @return The markup id of the form that submits the client info */ public String getFormMarkupId() { return form.getMarkupId(); } }
/** * Returns the javascript/css id of this form that will be used to generated the id="xxx" * attribute. * * @return The javascript/css id of this form. * @deprecated use {@link #getMarkupId()} */ protected final String getJavascriptId() { return getMarkupId(); }
/** * @return The markup id of the form that submits the client info */ public String getFormMarkupId() { return form.getMarkupId(); } }
/** * Returns the javascript/css id of this form that will be used to generated the id="xxx" * attribute. * * @return The javascript/css id of this form. * @deprecated use {@link #getMarkupId()} */ @Deprecated protected final String getJavascriptId() { return getMarkupId(); }
/** * Returns the id which will be used for the hidden div containing all parameter fields. * * @return the id of the hidden div */ private final String getHiddenFieldsId() { return getInputNamePrefix() + getMarkupId() + "_hf_0"; }
/** * Returns the id which will be used for the hidden div containing all parameter fields. * * @return the id of the hidden div */ private final String getHiddenFieldsId() { return getInputNamePrefix() + getMarkupId() + "_hf_0"; }
protected CharSequence getPreconditionScript() { return "return Wicket.$$(this)&&Wicket.$$('" + getForm().getMarkupId() + "')"; } }
/** * * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getPreconditionScript() */ @Override protected CharSequence getPreconditionScript() { return "return Wicket.$$(this)&&Wicket.$$('" + getForm().getMarkupId() + "')"; } }
/** * */ public void renderHead(IHeaderResponse response) { ResourceReference ref = new ResourceReference(RESOURCE_NAME); final String uploadFieldId = (uploadField == null) ? "" : uploadField.getMarkupId(); ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintStream js = new PrintStream(out); js.printf(" var def=new Wicket.WUPB.Def('%s', '%s', '%s', '%s','%s');", getMarkupId(), statusDiv.getMarkupId(), barDiv.getMarkupId(), urlFor(ref), uploadFieldId); js.printf(" new Wicket.WUPB(def).bind('%s');", getCallbackForm().getMarkupId()); response.renderOnDomReadyJavascript(new String(out.toByteArray())); }
/** {@inheritDoc} */ public void renderHead(IHeaderResponse response) { if (!isRootForm() && isMultiPart()) { // register some metadata so we can later properly handle multipart ajax posts for // embedded forms registerJavascriptNamespaces(response); response.renderJavascript("Wicket.Forms[\"" + getMarkupId() + "\"]={multipart:true};", Form.class.getName() + "." + getMarkupId() + ".metadata"); } }
@Override protected void onRenderProperties(JSONObject properties) throws JSONException { if (form.getOutputMarkupId()) { properties.put("formId", form.getMarkupId()); } url = form.urlFor(IFormSubmitListener.INTERFACE, null).toString(); super.onRenderProperties(properties); }
@Override public void onAfterRespond(Map<String, Component> map, IJavaScriptResponse response) { Set<Form<?>> formsToUpdate = new HashSet<>(); for (Map.Entry<String, Component> entry : map.entrySet()) { Component component = entry.getValue(); Form<?> form = component.findParent(Form.class); if(form!=null && form.isMultiPart()) formsToUpdate.add(form.getRootForm()); } for (Form<?> form : formsToUpdate) { response.addJavaScript("{var e = document.getElementById('"+form.getMarkupId()+"'); e.encoding= 'multipart/form-data'; e.encType=e.encoding;}"); } } }
@Override public void onAfterRespond(Map<String, Component> map, IJavaScriptResponse response) { Set<Form<?>> formsToUpdate = new HashSet<>(); for (Map.Entry<String, Component> entry : map.entrySet()) { Component component = entry.getValue(); Form<?> form = component.findParent(Form.class); if(form!=null && form.isMultiPart()) formsToUpdate.add(form.getRootForm()); } for (Form<?> form : formsToUpdate) { response.addJavaScript("{var e = document.getElementById('"+form.getMarkupId()+"'); e.encoding= 'multipart/form-data'; e.encType=e.encoding;}"); } } }
@Override protected CharSequence getPreconditionScript() { return "return Wicket.$$('" + getComponent().getMarkupId() + "') && Wicket.$$('" + getForm().getMarkupId() + "')"; } }
@Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.setMethod(Method.POST); attributes.setFormId(this.form.getMarkupId()); } }
/** * Returns the HiddenFieldId which will be used as the name and id property of the hiddenfield * that is generated for event dispatches. * * @return The name and id of the hidden field. */ public final String getHiddenFieldId() { String formId; if (!getPage().isPageStateless()) { // only assigned inside statefull pages WICKET-3438 formId = getMarkupId(); } else { formId = Form.getRootFormRelativeId(this).replace(":", "_"); } return getInputNamePrefix() + formId + "_hf_0"; }
@Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { super.onSubmit(target, form); target.appendJavaScript($(row).chain("remove").get()); target.appendJavaScript(String.format("onedev.server.form.markDirty($('#%s'));", form.getMarkupId(true))); rows.remove(row); onPropertyUpdating(target); }
/** * The form may intentionally be null */ @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); if (this.form != null) { attributes.setMethod(Method.POST); attributes.setFormId(this.form.getMarkupId()); attributes.setMultipart(this.form.isMultiPart()); } } }
@Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { super.onSubmit(target, form); target.appendJavaScript(String.format("onedev.server.form.markDirty($('#%s'));", form.getMarkupId(true))); target.appendJavaScript($(row).chain("remove").get()); rows.remove(row); if (rows.size() == 0) { WebMarkupContainer table = (WebMarkupContainer) PolymorphicListPropertyEditor.this.get("listEditor"); target.add(table.get("noElements")); } onPropertyUpdating(target); }
@Override protected void renderPlaceholderTag(ComponentTag tag, Response response) { if (isRootForm()) { super.renderPlaceholderTag(tag, response); } else { // rewrite inner form tag as div response.write("<div style=\"display:none\""); if (getOutputMarkupId()) { response.write(" id=\""); response.write(getMarkupId()); response.write("\""); } response.write("></div>"); } }