@SpringBean not working for IModel implementations?

2010-06-29 Thread David Meulemans
Hi

I've got an implementation of the IModel interface and I want to inject a
Spring bean in it.

In the method public String getObject(); this object is null.

Is it impossible to inject Spring beans with @SpringBean?

thx in advance!

David


Re: @SpringBean not working for IModel implementations?

2010-06-29 Thread James Carman
Try using

InjectorHolder.getInjector().inject(this);

inside your model implementation's constructor.

On Tue, Jun 29, 2010 at 9:30 AM, David Meulemans
meulemans.da...@gmail.com wrote:
 Hi

 I've got an implementation of the IModel interface and I want to inject a
 Spring bean in it.

 In the method public String getObject(); this object is null.

 Is it impossible to inject Spring beans with @SpringBean?

 thx in advance!

 David


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: @SpringBean not working for IModel implementations?

2010-06-29 Thread Ernesto Reinaldo Barreiro
I think component instantiation listener will only scan wicket
components. Just try

InjectorHolder.getInjector().inject(this);

on constructor of the model to get your dependencies injected.

Best,

Ernesto


On Tue, Jun 29, 2010 at 3:30 PM, David Meulemans
meulemans.da...@gmail.com wrote:
 Hi

 I've got an implementation of the IModel interface and I want to inject a
 Spring bean in it.

 In the method public String getObject(); this object is null.

 Is it impossible to inject Spring beans with @SpringBean?

 thx in advance!

 David


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: @SpringBean not working for IModel implementations?

2010-06-29 Thread david_

Thanks, I'll give it a try!

2010/6/29 Ernesto Reinaldo Barreiro-4 [via Apache Wicket] 
ml-node+2272202-1574848512-232...@n4.nabble.comml-node%2b2272202-1574848512-232...@n4.nabble.com


 I think component instantiation listener will only scan wicket
 components. Just try

 InjectorHolder.getInjector().inject(this);

 on constructor of the model to get your dependencies injected.

 Best,

 Ernesto


 On Tue, Jun 29, 2010 at 3:30 PM, David Meulemans
 [hidden email] http://user/SendEmail.jtp?type=nodenode=2272202i=0
 wrote:

  Hi
 
  I've got an implementation of the IModel interface and I want to inject a

  Spring bean in it.
 
  In the method public String getObject(); this object is null.
 
  Is it impossible to inject Spring beans with @SpringBean?
 
  thx in advance!
 
  David
 

 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2272202i=1
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2272202i=2



 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/SpringBean-not-working-for-IModel-implementations-tp2272189p2272202.html
 To start a new topic under Wicket - User, email
 ml-node+1842947-1066186228-232...@n4.nabble.comml-node%2b1842947-1066186228-232...@n4.nabble.com
 To unsubscribe from Wicket - User, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=bWV1bGVtYW5zLmRhdmlkQGdtYWlsLmNvbXwxODQyOTQ3fC0xOTcyOTcxMjQ2.




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SpringBean-not-working-for-IModel-implementations-tp2272189p2272642.html
Sent from the Wicket - User mailing list archive at Nabble.com.