diff --git a/forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/DateFilteredBootstrapPropertyColumn.java b/forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/DateFilteredBootstrapPropertyColumn.java index 0cddddb0..371f63cc 100644 --- a/forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/DateFilteredBootstrapPropertyColumn.java +++ b/forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/DateFilteredBootstrapPropertyColumn.java @@ -1,7 +1,8 @@ package org.devgateway.toolkit.forms.wicket.components.table; -import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterForm; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.TextFilteredPropertyColumn; import org.apache.wicket.model.IModel; @@ -32,7 +33,12 @@ public Component getFilter(final String componentId, final FilterForm form) { final DateFieldBootstrapFormComponent dateField = new DateFieldBootstrapFormComponent(componentId, getFilterModel(form)); dateField.hideLabel(); - dateField.getField().add(AttributeModifier.replace("onchange", "this.form.submit();")); + dateField.getField().add(new AjaxFormComponentUpdatingBehavior("change") { + @Override + protected void onUpdate(final AjaxRequestTarget target) { + target.add(form); + } + }); return dateField; } } diff --git a/forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/LocalDateFilteredBootstrapPropertyColumn.java b/forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/LocalDateFilteredBootstrapPropertyColumn.java index 47dcc389..05e91f09 100644 --- a/forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/LocalDateFilteredBootstrapPropertyColumn.java +++ b/forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/LocalDateFilteredBootstrapPropertyColumn.java @@ -1,7 +1,8 @@ package org.devgateway.toolkit.forms.wicket.components.table; -import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterForm; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.TextFilteredPropertyColumn; import org.apache.wicket.model.IModel; @@ -28,7 +29,12 @@ public Component getFilter(final String componentId, final FilterForm form) { final LocalDateFieldBootstrapFormComponent dateField = new LocalDateFieldBootstrapFormComponent(componentId, getFilterModel(form)); dateField.hideLabel(); - dateField.getField().add(AttributeModifier.replace("onchange", "this.form.submit();")); + dateField.getField().add(new AjaxFormComponentUpdatingBehavior("change") { + @Override + protected void onUpdate(final AjaxRequestTarget target) { + target.add(form); + } + }); return dateField; } }