On Fri, Apr 26, 2013 at 11:44 AM, Martin Grigorov <[email protected]> wrote: > Hi Igor, > > I saw your entry in the roadmap: > ================================== > h4. ajaxbehavior#updateAjaxAttributes() should get component passed in > > otherwise referencing the component as needed in throttle settings is > annoying > > {code} > queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") { > protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { > attributes.setThrottlingSettings(new > ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1))); > ----------------------------------------------------------------------------^ > {code} > ================================== > > Few comments > 1) the throttling id is not used for DOM selector so it could be anything. > Just make sure it is unique for all throttlers
yes. and the easiest/most obvious way to make sure it is unique is to use component's markup id as base, which we already know to be unique :) -igor > 2) the component is easily available via #getComponent() > (AbstractDefaultAjaxBehavior#getComponent()) > > I think we can spare this API break for the users > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com <http://jweekend.com/>
