// Path: web/src/main/java/org/sample/web/models/SubComponentWrapModel.java
// public class SubComponentWrapModel<T> implements IWrapModel<T> {
// 	
// 	private static final long serialVersionUID = 1L;
// 	private Component parent;
// 	
// 	public SubComponentWrapModel(Component parent) {
// 		this.parent=parent;
// 	}
// 
// 	/* (non-Javadoc)
// 	 * @see org.apache.wicket.model.IWrapModel#getWrappedModel()
// 	 */
// 	@Override
// 	public IModel<?> getWrappedModel() {
// 		return parent.getDefaultModel();
// 	}
// 
// 	@SuppressWarnings("unchecked")
// 	@Override
// 	public T getObject() {
// 		return (T) parent.getDefaultModelObject();
// 	}
// 
// 	@Override
// 	public void setObject(T object) {
// 		parent.setDefaultModelObject(object);
// 	}
// 
// 	@Override
// 	public void detach() {
// 		IModel<?> wrappedModel = getWrappedModel();
// 		if(wrappedModel!=null) wrappedModel.detach();
// 	}
// 
// }


import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.html.form.validation.FormComponentFeedbackBorder;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.sample.web.models.SubComponentWrapModel;
import de.agilecoders.wicket.core.markup.html.bootstrap.form.InputBehavior;
import de.agilecoders.wicket.core.markup.html.bootstrap.form.InputBehavior.Size;

/**
 * 
 */
package org.sample.web.components;



/**
 * @author mpostelnicu
 * 
 */
public abstract class GenericBootstrapFormComponent<TYPE, FIELD extends FormComponent<TYPE>> extends Panel {

	private static final long serialVersionUID = 1L;
	protected FormComponentFeedbackBorder border;
	protected FIELD field;
	
	protected InputBehavior sizeBehavior;
	
	@SuppressWarnings("unchecked")
	protected IModel<TYPE> initFieldModel() {
		if (getDefaultModel() == null)

// Path: web/src/main/java/org/sample/web/models/SubComponentWrapModel.java
// public class SubComponentWrapModel<T> implements IWrapModel<T> {
// 	
// 	private static final long serialVersionUID = 1L;
// 	private Component parent;
// 	
// 	public SubComponentWrapModel(Component parent) {
// 		this.parent=parent;
// 	}
// 
// 	/* (non-Javadoc)
// 	 * @see org.apache.wicket.model.IWrapModel#getWrappedModel()
// 	 */
// 	@Override
// 	public IModel<?> getWrappedModel() {
// 		return parent.getDefaultModel();
// 	}
// 
// 	@SuppressWarnings("unchecked")
// 	@Override
// 	public T getObject() {
// 		return (T) parent.getDefaultModelObject();
// 	}
// 
// 	@Override
// 	public void setObject(T object) {
// 		parent.setDefaultModelObject(object);
// 	}
// 
// 	@Override
// 	public void detach() {
// 		IModel<?> wrappedModel = getWrappedModel();
// 		if(wrappedModel!=null) wrappedModel.detach();
// 	}
// 
// }


// Path: web/src/main/java/org/sample/web/components/GenericBootstrapFormComponent.java
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.html.form.validation.FormComponentFeedbackBorder;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.sample.web.models.SubComponentWrapModel;
import de.agilecoders.wicket.core.markup.html.bootstrap.form.InputBehavior;
import de.agilecoders.wicket.core.markup.html.bootstrap.form.InputBehavior.Size;

/**
 * 
 */
package org.sample.web.components;



/**
 * @author mpostelnicu
 * 
 */
public abstract class GenericBootstrapFormComponent<TYPE, FIELD extends FormComponent<TYPE>> extends Panel {

	private static final long serialVersionUID = 1L;
	protected FormComponentFeedbackBorder border;
	protected FIELD field;
	
	protected InputBehavior sizeBehavior;
	
	@SuppressWarnings("unchecked")
	protected IModel<TYPE> initFieldModel() {
		if (getDefaultModel() == null)

			return new SubComponentWrapModel<TYPE>(this);
