>> As a new user of tapestry, loop actually bit me because I assumed it did >> this already and was surprised in my event handlers when my value binding >> was null. >> <a class="fancy" t:type="eventlink" event="select"><t:body /></a> > > Why not passing the current object as the context of the EventLink instead? > > <a class="fancy" t:type="eventlink" event="select" > t:context="value.id"><t:body /></a> > > public Object onSelect(IdType id) { > ... >> }
1. What if the eventlink is nested several layers deep in components? Then value has to be passed all the way down... 2. Now the nested component needs to know about how the value object is encoded, which makes the nested component less "generic" and therefore less reusable. In my sample, nestedcomponent doesn't know anything at all about "value". It doesn't need to! It's job is just to generate a "fancy" link. Instead, that knowledge is localized to where loop is used, which also happens to be where the event is processed. Pierce --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org