wicket-jquery-ui icon indicating copy to clipboard operation
wicket-jquery-ui copied to clipboard

Change event delayed on NumberTextField

Open VaclavC opened this issue 6 years ago • 4 comments

Hello, I'am using com.googlecode.wicket.kendo.ui.form.NumberTextField in Wicket Form. I have AjaxFormSubmitBehavior on that form (catching "change" event). But it isn't fired right after value of field is changed, it is fired after that field loses focus (probably). When I try it with org.apache.wicket.markup.html.form.NumberTextField everything works.

How this should be done properly?

Relevant code snippet:

Form<Void> form;
add(form = new Form<Void>("form"));
form.setOutputMarkupId(true);
		
form.add(new AjaxFormSubmitBehavior("change")
{
	@Override
	protected void onSubmit(AjaxRequestTarget target)
	{
		System.out.println(String.format("CHANGED (%d, %d)", rokOd, rokDo));
	}
});

form.add(new NumberTextField<Integer>("inputOd", new PropertyModel<Integer>(this, "rokOd")));
form.add(new NumberTextField<Integer>("inputDo", new PropertyModel<Integer>(this, "rokDo")));

VaclavC avatar Nov 09 '18 15:11 VaclavC

Try with input event.

martin-g avatar Nov 11 '18 19:11 martin-g

Doesn't work at all.

VaclavC avatar Nov 11 '18 20:11 VaclavC

I've removed my previous comment because it was not fully relevant. The best here is to look at usages in the code for IValueChangedListener and OnChangeAjaxBehavior and do implement the same way.

sebfz1 avatar Nov 12 '18 01:11 sebfz1

Will try it, but it looks complicated (I'am looking at AjaxSlider and AjaxSliderBehavior).

VaclavC avatar Nov 12 '18 10:11 VaclavC