Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change event delayed on NumberTextField #300

Open
VaclavC opened this issue Nov 9, 2018 · 4 comments
Open

Change event delayed on NumberTextField #300

VaclavC opened this issue Nov 9, 2018 · 4 comments

Comments

@VaclavC
Copy link

VaclavC commented Nov 9, 2018

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")));
@martin-g
Copy link
Collaborator

Try with input event.

@VaclavC
Copy link
Author

VaclavC commented Nov 11, 2018

Doesn't work at all.

@sebfz1
Copy link
Owner

sebfz1 commented Nov 12, 2018

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.

@VaclavC
Copy link
Author

VaclavC commented Nov 12, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants