Example usage for org.apache.wicket.markup.html.form Form getRootForm

List of usage examples for org.apache.wicket.markup.html.form Form getRootForm

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form Form getRootForm.

Prototype

public Form<?> getRootForm() 

Source Link

Document

Returns the root form or this, if this is the root form.

Usage

From source file:com.servoy.extensions.beans.dbtreeview.table.InmethodDBTreeTableView.java

License:Open Source License

@Override
protected void onJunctionLinkClicked(AjaxRequestTarget target, Object node) {
    super.onJunctionLinkClicked(target, node);

    // we need to clear all inputs of the form,
    // because this onjunctionclicked is done by a form submit so all 
    // fields have there rawInput set.
    Form<?> form = getForm();
    if (form != null) {
        Form<?> rootForm = form.getRootForm();
        if (rootForm != null) {
            form = rootForm;/*from w w w  .j  a  v a2 s .  c o m*/
        }
        if (!form.hasError()) {
            form.clearInput();
        }
    }
}

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  w  w w.  j  a va2s  .  c o 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.cipango.ims.hss.web.spt.EditSptsPage.java

License:Apache License

protected static boolean isRequired(Form form) {
    if (form == null || form.getRootForm().findSubmittingButton() == null)
        return false;
    return "ok".equals(form.getRootForm().findSubmittingButton().getInputName());
}

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

License:Apache License

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

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

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

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

    attributes.setPreventDefault(true);
}