Christian Helmbold wrote:
I've found a workaround. Not elegant, but it works:
public class ArticlePage extends WebPage
{
@SpringBean
private ArticleRepository repository;
private Article article;
public ArticlePage()
{
InjectorHolder.getInjector().inject(this);
construct(repository.findByName("index"));
}
private void construct(Article article)
{
add(new Label("name", new PropertyModel(article, "name")));
//...
}
}
It looks a bit better than service locator pattern but not much. Any other
suggestions?
Create a abstract (or not) function on the base class and call it from
the base (now without arguments) constructor. Override this function to
return what you want based on "repository".
Adriano
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org