but can you do
class EntityModel extends LoadableDetachableModel {
@Injectable private SessionFactory sf;
private Class clazz;
private Serializable id;
pulblic(Class clazz, Serializable id) { this.clazz=clazz; this.id=id; }
public Object load() {
return sf.currentSession().load(clazz, id);
}
// for testing
public void setSessionFactory(SessionFactory sf) { this.sf=sf; }
}
add(new UserEditorPanel("editor", new EntityModel(User.class, 15L)));
with salve.googlecode.com you can! :)
-igor
On 10/19/07, kent lai <[EMAIL PROTECTED]> wrote:
> My personal practice has been to abstract the bean lookup with an
> interface called bean locator, and then create a subclass
> implementing it with ApplicationContextAware. Then inject that class
> into my WebApplication. Then my application looks up the required
> bean from the WebApplication's bean locator class.
>
> My bean locator also customized the lookup via class type (since I
> don't really have multiple classes of the same 'type')
>
> Guess I just liked to keep my pages lean...
>
>
> On 19 Oct 2007, at 11:40 PM, James Perry wrote:
>
> > Dear Wicket community,
> >
> > What are the best practises and advice for integrating Wicket with
> > Spring. I
> > have read the Wiki so I'm aware of injecting Spring's beans using
> > annotations. I am also interested to know if I should just keep an
> > Spring
> > ApplicationContext in Wicket's Application class, inject the proxy-
> > based
> > Service POJOs into the Application or just inject them into each
> > component
> > that needs to use my service's methods?
> >
> > Look forward to your advice,
> > James.
>
>
>
> ---------------------------------------------------------------------
> 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]