What I mean by final value is value selected from list of options. The OnChangeAjaxBehavior you suggested will do ajax on every key stroke. So lets say my autocomplete display list of cities. I want the method called when user selects a value "London" from list. Not on each stoke "L", "Lo", "Lon"...
As I said, this is because I need to use the selected value for additional processing. On Thu, Jan 21, 2016 at 9:56 AM, Martin Grigorov <[email protected]> wrote: > Hi, > > How do you decide when "final" value is entered ? > You can use Ajax throttling to avoid sending requests on every typed > character but only after N ms after the last typed character. See > AjaxRequestAttributes#setThrottling() for this option. > There is no magic that will read your users' mind to tell whether an > entered value is final or not. > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros <[email protected]> > wrote: > > > Hey, > > > > sorry for not explaining properly... > > I already tried that and in this case the the ajax call is triggered > > on "inputchange" as well, meaning on every key stroke. > > > > This is not desirable because we use the value of this autocomplete field > > to calculate value of another fields in form. This calculation should > > happen only > > when "final" value is selected. > > > > Zbynek > > > > On Thu, Jan 21, 2016 at 9:27 AM, Martin Grigorov <[email protected]> > > wrote: > > > > > Hi, > > > > > > It is not very clear what exactly is the issue. > > > As far as I understand the problem is that the Ajax call is triggered > > only > > > when you navigate to another form field. If this is the issue then try > by > > > using OnChangeAjaxBehavior instead of > AjaxFormComponentUpdatingBehavior. > > > > > > Martin Grigorov > > > Wicket Training and Consulting > > > https://twitter.com/mtgrigorov > > > > > > On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros <[email protected] > > > > > wrote: > > > > > > > Hi, > > > > > > > > in our project we have an AutoCompleteTextField with > > > > AjaxFormComponentUpdatingBehavior ("change" event) attached. > > > > > > > > Small prototype I did proves that HTTP POST is done when an item is > > > > selected from choices (either by mouse or keyboard). But for some > > reason > > > > the same code doesn't work in our project. It is required to move > focus > > > to > > > > another component for the POST to be send. The behavior works like if > > > > "blur" type of event is set but there is "change". > > > > > > > > I'm quite new to Wicket so I tried to compare all HTML & JS files but > > > they > > > > all seem to be the same. > > > > Is there some other debug I can use to find what is going on (I > suspect > > > > something in JS but JS isn't my specialty) ? > > > > > > > > > > > > Oh and both wicket-core and wicket-extension is 7.0.0. > > > > > > > > Thanks, > > > > Zbynek > > > > > > > > > >
