@Override protected void onUpdate(AjaxRequestTarget target) { AutoCompleteTextFieldWidget.this.onUpdate(target); } });
public AutoCompleteTextFieldWidget(final String id, final IModel<T> model, final AutoCompleteSettings settings) { super(id, model, settings); add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { AutoCompleteTextFieldWidget.this.onUpdate(target); } }); }
@Override protected void onRemove() { final AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class); if (target != null) { final String containerId = getMarkupId() + "-autocomplete-container"; // Remove element and add a second check after 1 second which ensures the element is also removed if // the AutoCompleteTextFieldWidget is used in a dialog that is closed by pressing ESC while the // AutoComplete is starting to render. final String js = String.format( "if (jQuery) { " + "jQuery('#%s').remove(); " + "window.setTimeout(function() { " + "jQuery('#%s').remove() " + "}, 1000); " + "}", containerId, containerId); target.getHeaderResponse().render(OnLoadHeaderItem.forScript(js)); } super.onRemove(); }
@Override protected void onUpdate(final AjaxRequestTarget target) { super.onUpdate(target); target.add(ddChoice); target.add(checkBox); target.add(valuesContainer); focusOnLatestValue = true; } };