/** * This implementation uses the {@link #modelCache} to avoid recreating over and over * different models for the various items, this allows the grid panel to be editable */ public final IModel model(Object object) { if(editable) { IModel result = modelCache.get((T) object); if(result == null) { result = newModel(object); modelCache.put((T) object, result); } return result; } else { return newModel(object); } }
/** * This implementation uses the {@link #modelCache} to avoid recreating over and over different * models for the various items, this allows the grid panel to be editable * * @see org.apache.wicket.markup.repeater.data.IDataProvider#model(java.lang.Object) */ @Override public final IModel<T> model(T object) { if (editable) { IModel<T> result = modelCache.get(object); if (result == null) { result = newModel(object); modelCache.put((T) object, result); } return result; } else { return newModel(object); } }