Example usage for org.apache.wicket.ajax.attributes AjaxRequestAttributes setMultipart

List of usage examples for org.apache.wicket.ajax.attributes AjaxRequestAttributes setMultipart

Introduction

In this page you can find the example usage for org.apache.wicket.ajax.attributes AjaxRequestAttributes setMultipart.

Prototype

public AjaxRequestAttributes setMultipart(boolean multipart) 

Source Link

Document

Determines whether the form submit is multipart.

Usage

From source file:com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxPostBehavior.java

License:Apache License

/**
 * The form may intentionally be null/*  ww  w.  j a v a  2 s.c o  m*/
 */
@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());
    }
}

From source file:name.martingeisse.wicket.component.stateless.StatelessAjaxFormSubmitBehavior.java

License:Apache License

@Override
protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
    super.updateAjaxAttributes(attributes);

    final Form<?> form = getForm();
    attributes.setFormId(form.getMarkupId());

    final String formMethod = form.getMarkupAttributes().getString("method");
    if (formMethod == null || "POST".equalsIgnoreCase(formMethod)) {
        attributes.setMethod(Method.POST);
    }//from   ww w. j ava  2  s .  co  m

    if (form.getRootForm().isMultiPart()) {
        attributes.setMultipart(true);
        attributes.setMethod(Method.POST);
    }

    if (getComponent() instanceof IFormSubmittingComponent) {
        final String submittingComponentName = ((IFormSubmittingComponent) getComponent()).getInputName();
        attributes.setSubmittingComponentName(submittingComponentName);
    }
}

From source file:org.wicketstuff.stateless.behaviors.StatelessAjaxFormSubmitBehavior.java

License:Apache License

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
    super.updateAjaxAttributes(attributes);

    Form<?> form = findForm();/*from  ww w  .j a v a2  s.co m*/
    attributes.setFormId(form.getMarkupId());

    String formMethod = form.getMarkupAttributes().getString("method");
    if (formMethod == null || "POST".equalsIgnoreCase(formMethod)) {
        attributes.setMethod(Method.POST);
    }

    if (form.getRootForm().isMultiPart()) {
        attributes.setMultipart(true);
        attributes.setMethod(Method.POST);
    }

    attributes.setPreventDefault(true);
}