Hello,

I don't understand why a cell item gets a model, because I have not seen
where it is used. Only the model in the row item is used, together with the
property of the column.

Also why is the populator of the column in that model?


public abstract class AbstractDataGridView<T> extends DataViewBase<T>
@Override
protected final void populateItem(final Item<T> item)
{

                RepeatingView cells = new RepeatingView(CELL_REPEATER_ID);
item.add(cells);

                int populatorsNumber = populators.size();
for (int i = 0; i < populatorsNumber; i++)
{
ICellPopulator<T> populator = populators.get(i);
IModel<ICellPopulator<T>> populatorModel = new Model<>(populator);
Item<ICellPopulator<T>> cellItem = newCellItem(cells.newChildId(), i,
populatorModel);
cells.add(cellItem);
...

For example here we see that the row model + property of the column is
used, and not the model of the cell item:

public class PropertyPopulator<T> implements ICellPopulator<T>
@Override
public void populateItem(final Item<ICellPopulator<T>> cellItem, final
String componentId,
final IModel<T> rowModel)
{
cellItem.add(new Label(componentId, new PropertyModel<>(rowModel,
property)));
}

Thanks.

Reply via email to