Example usage for org.apache.wicket.ajax.markup.html.form AjaxSubmitLink setBody

List of usage examples for org.apache.wicket.ajax.markup.html.form AjaxSubmitLink setBody

Introduction

In this page you can find the example usage for org.apache.wicket.ajax.markup.html.form AjaxSubmitLink setBody.

Prototype

public AbstractLink setBody(final IModel<?> bodyModel) 

Source Link

Document

Sets the link's body model

Usage

From source file:name.martingeisse.wicket.component.stdform.StandardFormPanel.java

License:Open Source License

/**
 * Adds an AJAX submit button for the form. 
 * @param text the button text/*w  w w .j  av a2  s .c o m*/
 */
public final void addAjaxSubmitButton(final String text) {
    final AjaxSubmitLink submitLink = new AjaxSubmitLink("button") {
    };
    submitLink.setBody(Model.of(text));
    addRawFormElement(new Fragment(newRawFormElementId(), "submitButtonFragment", this).add(submitLink));
}