Title: Using ioc plugin in viewlet event handler
Thread: Using ioc plugin in viewlet event handler
Forum: Need Help?
User: doryphores Hello,
I'm new to ColdBox and I'm quite impressed so far. One question
regarding viewlets and ioc:
Here's the situation:
I have a menu viewlet
that I want to render in my layout. The viewlet runs an event to to get the menu
data from the model. In the init function of the viewlet handler, I call the ioc
plugin (I'm using lightwire for ioc) to get a reference to one of my model
When I run the page, coldbox tells me that the getBean
method of the factory doesn't exist (on the iocfactory object). When I check the
ioc plugin instance, it is empty (the iocfactory is missing). This is strange
because in my other handlers, the ioc plugin works fine.
attached file for code examples