Would something as minor as this be considered for the core?
I find it useful because I often want a component (in may case a Label type)
to render a short message if the model is null e.g. "n/a" or "please select
a type of cheese". I first tried extending Label to do this, but hit a wall
because getDefaultModelObjectAsString is final (onComponentTagBody is
protected, but getDefaultModelObjectAsString returning "" is not the same as
null).
Let me know if there's a nicer way to achieve the same thing. class
DefaultPropertyModel<T> extends PropertyModel<T> { private T defaultModel;
public DefaultPropertyModel(Object modelObject, String expression, T
defaultObject) { super(modelObject, expression); this.defaultModel =
defaultObject; } @Override public T getObject() { T o = super.getObject();
if (o == null) return this.defaultModel; return o; } } --
___________________________ http://stubbisms.wordpress.com/