Package de.agilecoders.wicket.core.markup.html.bootstrap.navbar

Source Code of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarForm

package de.agilecoders.wicket.core.markup.html.bootstrap.navbar;

import de.agilecoders.wicket.core.markup.html.bootstrap.form.BootstrapForm;

import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.panel.IMarkupSourcingStrategy;
import org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy;
import org.apache.wicket.model.IModel;

/**
* A form implementation for the {@link Navbar} component which
* behaves like a {@link org.apache.wicket.markup.html.panel.Panel}.
*
* @author miha
*/
public class NavbarForm<T> extends BootstrapForm<T> {

    /**
     * Construct.
     *
     * @param componentId the component id
     */
    public NavbarForm(String componentId) {
        super(componentId);
    }

    /**
     * Construct.
     *
     * @param componentId the component id
     * @param model the form model
     */
    public NavbarForm(String componentId, IModel<T> model) {
        super(componentId, model);
    }

    @Override
    protected void onInitialize() {
        super.onInitialize();

        add(new NavbarFormBehavior());
    }

    @Override
    public void onComponentTag(ComponentTag tag) {
        if (!"form".equals(tag.getName())) {
            tag.setName("form");
        }

        super.onComponentTag(tag);
    }

    @Override
    protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
        return new PanelMarkupSourcingStrategy(false);
    }
}
TOP

Related Classes of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarForm

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.