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

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

Introduction

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

Prototype

public AjaxRequestAttributes setFormId(final String formId) 

Source Link

Usage

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

License:Apache License

/**
 * The form may intentionally be null//from  ww  w  . j av  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);
    }/*www  .  j av  a  2s. 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 a  2  s . c  om
    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);
}