Some Models maybe? Right now I have a few of them where I have InjectorHolder.getInjector().inject(this);
But maybe you are right and this out of Wicket's "scope". Ernesto On Thu, Sep 23, 2010 at 12:11 PM, Bas Gooren <b...@iswd.nl> wrote: > I'd be curious to hear for what "other classes" you have in mind. You'll > always need to call the instantiation listener at some point to invoke the > injector. > So simply implementing IInstantiable will not be enough to have injection > magically work. > > I think the reason it's currently implemented the way it is, is that all > components have a Component base class which can abstract behavior like > this. > > In case you want dependency injection anywhere, you should take a look at > something like Salve (http://code.google.com/p/salve/) > > Sebastian > > ----- Original Message ----- From: "Ernesto Reinaldo Barreiro" > <reier...@gmail.com> > To: <users@wicket.apache.org> > Sent: Thursday, September 23, 2010 12:07 PM > Subject: Re: using IOC in panels? > > > Shall I create an RFE? Or this something that does not make much sense? > > Ernesto > > On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael > <nino.martinez.w...@gmail.com> wrote: >> >> yeah that would be handy. >> >> 2010/9/23 Ernesto Reinaldo Barreiro <reier...@gmail.com>: >>> >>> Martin, >>> >>> Yes, I see: >>> >>> getApplication().notifyComponentInstantiationListeners(this); >>> >>> Would it make sense (for 1.5) to have: >>> >>> -an interface IInstantiable >>> -modify >>> >>> public interface IComponentInstantiationListener >>> { >>> /** >>> * Called for every component that is instantiated. This method is called >>> * <strong>during</strong> construction, so do not depend on the >>> construction being completed >>> * yet. The id is guaranteed to be set before this call. >>> * >>> * @param component >>> * the component that is being instantiated. >>> */ >>> void onInstantiation(IInstantiable component); >>> } >>> >>> So that other classes could use the same trick by implementing >>> IInstantiable ? >>> >>> Cheers, >>> >>> Ernesto >>> >>> On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov <mgrigo...@apache.org> >>> wrote: >>>> >>>> Panel's constructor calls super() and Component's ctor asks the >>>> instantiation listener to do its work >>>> >>>> On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < >>>> reier...@gmail.com> wrote: >>>> >>>>> There is a component instantiation listener that takes care of that: >>>>> you just use new as "always". >>>>> >>>>> Ernesto >>>>> >>>>> On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael >>>>> <nino.martinez.w...@gmail.com> wrote: >>>>> > but how should panel then be managed.. >>>>> > >>>>> > Because if I create the panel myself in the page it won't work right? >>>>> > Can I ask wicket to instansiate my panel? >>>>> > >>>>> > 2010/9/23 Martin Grigorov <mgrigo...@apache.org>: >>>>> >> Panel is a Component, so you can use @Inject on the Panel members. >>>>> >> Use Injector.get().inject(target) only in non Component classes. >>>>> >> >>>>> >> P.S. The API above is for 1.5. >>>>> >> >>>>> >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < >>>>> >> martin.maku...@koodaripalvelut.com> wrote: >>>>> >> >>>>> >>> You must weigh benefits and cons about whereto manage your IOC. >>>>> >>> >>>>> >>> ** >>>>> >>> Martin >>>>> >>> >>>>> >>> 2010/9/23 nino martinez wael <nino.martinez.w...@gmail.com>: >>>>> >>> > I need to be able to inject a service into my panel.. >>>>> >>> > >>>>> >>> > Should I then just use: >>>>> >>> > >>>>> >>> > org.apache.wicket.injection.Injector.get().inject(Object object). >>>>> >>> > >>>>> >>> > or are there are prettier way? I feel that calling >>>>> >>> > org.apache.wicket.injection.Injector.get().inject(Object object) >>>>> >>> > inside my panels sort of violates the IOC principle? >>>>> >>> > >>>>> >>> > 2010/9/23 Martin Makundi <martin.maku...@koodaripalvelut.com>: >>>>> >>> >> What is your need exactly? >>>>> >>> >> >>>>> >>> >> ** >>>>> >>> >> Martin >>>>> >>> >> >>>>> >>> >> 2010/9/23 nino martinez wael <nino.martinez.w...@gmail.com>: >>>>> >>> >>> Hi >>>>> >>> >>> >>>>> >>> >>> what should I do if I want to use IOC in my panels? In short I >>>>> >>> >>> >>> >>> need >>>>> a >>>>> >>> >>> sort of a provider injected into a panel, what's the prettiest >>>>> >>> >>> >>> >>> way >>>>> to >>>>> >>> >>> do it? >>>>> >>> >>> >>>>> >>> >>> regards Nino >>>>> >>> >>> >>>>> >>> >>> >>>>> --------------------------------------------------------------------- >>>>> >>> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> >>> >>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >>> >>> >>>>> >>> >>> >>>>> >>> >> >>>>> >>> >> >>>>> --------------------------------------------------------------------- >>>>> >>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> >>> >> For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >>> >> >>>>> >>> >> >>>>> >>> > >>>>> >>> > >>>>> >>> > --------------------------------------------------------------------- >>>>> >>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> >>> > For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >>> > >>>>> >>> > >>>>> >>> >>>>> >>> >>>>> >>> --------------------------------------------------------------------- >>>>> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> >>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >>> >>>>> >>> >>>>> >> >>>>> > >>>>> > --------------------------------------------------------------------- >>>>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> > For additional commands, e-mail: users-h...@wicket.apache.org >>>>> > >>>>> > >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >>>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org