Hi Erik,
you can override a factory method in a tree subclass:
@Override
protected Component newContentComponent(String id,
IModel<Foo> model)
{
return new Folder<Foo>(id, this, model) {
protected IModel<?> newLabelModel(IModel<Foo> model)
{
// decide how to render each foo, e.g. use a
property model
return new PropertyModel<String>(model, "bar");
}
};
}
Have fun
Sven
On 03/11/2011 05:37 PM, Erik Johansson wrote:
Hello.
I am trying out wicket-tree, by Sven Maier. However I can't figure out what
is needed to get it to display the tree properly.
It shows the content as its toString method. I have overridden it at the
ITreeProvider.model-method, but that isn't it, it seems. The original
object's toString() is not at all appropriate in the tree.
Where should I do the override in this case?
I am using Wicket 1.4.15 and wicket-tree 0.4.1
Erik Johansson
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org