Hi, Wicket is not managed framework, i.e. it doesn't instantiate the components for you. You can use IComponentInstantiationListener in your application though! If your component implements some custom interface then call its #postConstruct(). I'm not convinced that each and every application needs this.
Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Aug 19, 2016 at 8:29 AM, Илья Нарыжный <[email protected]> wrote: > Hello, > > There is a pain: components sometimes have a bunch of constructors, but > very often it's needed to configure something for that component in common. > And there are 2 ways to do that today: > > 1) Either explicitly call some single method from every constructor. > 2) Or use onInitialize() method. > > But both of them have disadvantages: > > If first one has been used: it's pretty easy to forgot about necesity to > invoke some other method in some new constructor if you will need to add > that. > > And second is not good because it's not possible to use constructions like > that in parent component: > > add(new MyChildComponent("id", ....).setSomething(XXX)); > > because if "something" was set in onInitialize() - that will override > setting that param in code above. > > > Thanks, > > Ilya > > --------------------------------------------- > Orienteer(http://orienteer.org) - open source Business Application > Platform >
