mstahv / touchkit-with-cdi

An example how to use Vaadin CDI together with TouchKit
0 stars 0 forks source link

Injecting EJB in FormView #1

Open maja1000 opened 7 years ago

maja1000 commented 7 years ago

How do I inject a EJB in FormView, @CDIView is not possible, so how can I do that?

mstahv commented 7 years ago

Don't know if this is still relevant but if your view cannot be cdiview, it can probably still be basic UIScoped CDI bean, where you can inject stuff like EJBs.

If it can't be a CDI bean at all for some reason, inject it to your UI and fetch the reference to EJB via it using the UI.getCurrent() method.