org.wicketstuff.egrid.column.AbstractEditablePropertyColumn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wicketstuff-editable-grid Show documentation
Show all versions of wicketstuff-editable-grid Show documentation
Add/Edit/Delete functionality all at once
package org.wicketstuff.egrid.column;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
/**
*
* @author Nadeem Mohammad
*
*/
public abstract class AbstractEditablePropertyColumn extends PropertyColumn implements IEditableGridColumn
{
private static final long serialVersionUID = 1L;
private boolean isEditable = true;
public AbstractEditablePropertyColumn(IModel displayModel, String propertyExpression)
{
super(displayModel, propertyExpression);
}
public AbstractEditablePropertyColumn(IModel displayModel, String propertyExpression, boolean isEditable)
{
super(displayModel, propertyExpression);
this.isEditable = isEditable;
}
@SuppressWarnings("unchecked")
@Override
public final void populateItem(final Item> item, final String componentId, final IModel rowModel)
{
final Item rowItem = ((Item) item.findParent(Item.class));
if (inEditiingMode(rowItem) && isEditable)
{
EditableCellPanel provider = getEditableCellPanel(componentId);
FormComponent> editorComponent = provider.getEditableComponent();
editorComponent.setDefaultModel((IModel
© 2015 - 2025 Weber Informatics LLC | Privacy Policy