I've just recently added a onEvent mixin to tapestry-stitch... it sounds like exactly what you're after http://tapestry-stitch.uklance.cloudbees.net/oneventdemo
On 26 June 2013 18:14, Ben Titmarsh <ben.titma...@hotmail.co.uk> wrote: > Hi All, > > I am generating ~100 select items in a loop and would like to listen for > the ajax onChange event for each of these. I am getting the event > successfully using the following: > > <t:zone t:id="gridZone"> > ... > <t:select t:id="colourProfileOverride" > t:value="cubeCard.colourCombinationOverride" t:zone="gridZone"> > ... > </t:zone> > > public Object onChangeFromColourProfileOverride() { > ... > return gridZone.getBody(); > } > > The value is set as expected on the cubeCard.colourCombinationOverride > object, however in order to know which select was updated I need some sort > of context value. > > I have played around with the jquery/bind mixin and can get it to do what > I would like but it involves setting bind.callback="function(event,ui,url) > { url.addContext(event.target.value); } on each of my select components. > This significantly reduces client side performance. > > So I'd like to know if anyone has figured out a way to pass a context > value in onChange Ajax requests from select components? My ideal situation > would be to end up with something along these lines: > > <t:select t:id="colourProfileOverride" > t:value="cubeCard.colourCombinationOverride" t:context="myId" > t:zone="gridZone"> > > public Object onChangeFromColourProfileOverride(Integer myId) { > ... > } > > Thanks, > Ben. >