You can't predict every use case ... in fact, IMHO, some of the weaker parts of Tapestry are where we tried to predict how something would be used, rather than react to new (and valid) use cases.
On Tue, Sep 6, 2011 at 5:48 AM, Amaury Willemant <awillemant....@gmail.com> wrote: > Hi everyone, > > I am currently working on an implementation of a Liferay portlet using > Tapesty 5.1.0.5 and I need to add a prefix for all the ids written in the > generated HTML and the associated javascript. I knew that Tapestry was able > to add a numeric suffix (xxx_0, xxx_1, etc...) and that is how I discovered > the IdAllocator class and its differents uses in Tapestry. > > I was really surprised because it seems to be only a simple POJO, so ? how > to override it with Tapestry IOC ? > > The prefix I need to add is a piece of information stored in the Request > service and changes for each request, how to inject it in a clean way ? > > I began to write a new service named "IdAllocatorFactory" which provides a > new IdAllocator (that I rewrote to add a prefix field) then I patched all > the classes which instantiate an IdAllocator (Form, FormInjector, > RenderSupport, ...) in order to make them use my brand new factory. > > But I feel that it is too much ! Tapestry offers great functionnalities, it > is very easy to extend or override, did I forgot something ? Is it mandatory > to replace so many classes ? > > Please ! Tell me that there is an easier and cleaner way to add this prefix > in front of all the HTML Ids ! Please ! > > Thank you in advance, > > Amaury > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org