this panel factory is what i have done in the past also. although i
simply had a generic IComponentFactory { Component newComponent(String
id); } which seemed to work for most cases.

the problem with injecting panels like that directly is that wicket
_has to_ proxy these injected values. There are a couple of ways
around this:

a) we can check if the object is a subclass of Component and choose not to proxy
b) we can add a proxy attribute to @SpringBean that can be set to false

feel free to add these as an rfe, but i think the component factory is
a good solution.

-igor


On Fri, Feb 22, 2008 at 5:01 AM, Ned Collyer <[EMAIL PROTECTED]> wrote:
>
>
>  Stefan Fußenegger wrote:
>  >
>  > Hi Tom,
>  >
>  > I'd suggest not to use Spring to manage panels. You should rather create a
>  > new panel for every page and request. You should use Spring to manage your
>  > services and inject those into your panels.
>  >
>  > Best regards, Stefan
>  >
>
>  Hi Stephan :) (I work with Tom)
>
>  We have a work around for this specific problem, and it still involves
>  spring, but not using panels directly.
>
>  Basically the situation is as follows.
>
>  We have a main wicket project which is published as a jar.
>
>  There are also other modules also published as "plugin" jars.
>
>  We launch these with an embedded jetty instance.
>
>  The problem is the Main project contains the page instances, and the other
>  jars contain the panels.
>
>  The Main project has no idea about which panels are available, as these will
>  be determined at run time by whatever has been configured (thru spring).
>  The main jar has no knowledge of which panel classes exist - so we cannot
>  really instantiate new ones using plain old java.
>
>  There are a few ways to approach this, ie, having some class loader which
>  resolves given string "class references", and those strings are wired in
>  through spring.  This works - but feels a bit hacky.
>
>  Our workaround is .. somewhat similar - we basically have a panel factory in
>  the plugin that instantiate a panel and return it.  We can then wire these
>  panel factories thru spring to a given page.
>
>  This turns out to be quite elegant - however it would be nice if we had the
>  ability to wire "plugin" panels to the main jar directly without this
>  factory.
>
>  Rgds
>
>  Ned
>  --
>  View this message in context: 
> http://www.nabble.com/Accessing-prototype-scoped-panel-beans-using-%40SpringBean-annotation-tp15627974p15632893.html
>
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to