And if you are performance oriented you use @Retain private BeanModel model; { model = beanModelSource.create(ProjectProposal.class, true, messages); model.add("organization"); model.add("financier"); model.add("priorization", null); } public BeanModel getModel(){ return model; }
This way the model is generated _once_ and kept in the field through _all_ requests. Can be used as long as the model is the same for each and every request. (And it usually is.) Thiago H. de Paula Figueiredo wrote: > > Em Thu, 28 Aug 2008 07:03:43 -0300, Markus Joschko > <[EMAIL PROTECTED]> escreveu: > >> Not sure if I get this. Wouldn't that make it quite hard to get hold >> of the BeanModelSource service? > > Sorry, I'm not following you. > > I always do something like this: > > @Inject > private BeanModelSource beanModelSource; > > @Inject > private ComponentResources componentResources; > > public BeanModel getBeanModel() { > BeanModel model = beanModelSource.create(YourClass.class, false, > componentResources); > ... > return model; > } > > Thiago > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Best-action-event-to-setup-a-model--tp19189515p19214055.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]