On Thu, Feb 5, 2009 at 10:33 PM, Dave Greggory <davegregg...@yahoo.com> wrote:
> Is it possible dynamically (programmatically) request a component from 
> tapestry's IoC (without using @Inject or passing component via parameter)?
>
> I have this MyComponentInterface and a whole bunch of components that 
> implement it (ie. MyComponent1, MyComponent2, etc). I do not know until 
> runtime if any of these components will be rendered or exactly which 
> implementation will be used. On top of that, MyComponent1 may be rendered 
> multiple times (each time with a different configuration) and I do not know 
> the number of times till runtime either.
>
> So, is it possible to grab a component from IoC at runtime?

AFAIK, no. Components are handled outside Tapestry-IoC. I suggest you
to use blocks and the Delegate component to accomplish what you want.
There's a simple example at
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Delegate.html.

-- 
Thiago

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

Reply via email to