@SuppressWarnings("unchecked") public IModel<T> getModel() { return (IModel<T>) getDefaultModel(); }
public Component getFocusComponent() { return getFormComponent(); }
public T getModelObject() { return getModel().getObject(); }
public AjaxUpdatingWidget<?> setFocus(AjaxUpdatingWidget<?> widget) { setFocus(widget.getFocusComponent()); return widget; } }
@Override protected void onUpdate(final AjaxRequestTarget target) { AjaxUpdatingWidget.this.onUpdate(target); } });
/** * Adds an ajax updating form component */ protected void addFormField(final FormComponent<T> component) { add(formComponent = component); component.setOutputMarkupId(true); if(throttleDelay == null) { component.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(final AjaxRequestTarget target) { AjaxUpdatingWidget.this.onUpdate(target); } }); } else { component.add(new OnChangeAjaxBehavior() { @Override protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.setThrottlingSettings(new ThrottlingSettings(component.getMarkupId(), throttleDelay)); } @Override protected void onUpdate(final AjaxRequestTarget target) { AjaxUpdatingWidget.this.onUpdate(target); } }); } }
public AjaxUpdatingWidget<?> setFocus(AjaxUpdatingWidget<?> widget) { setFocus(widget.getFocusComponent()); return widget; }
@Override protected void onUpdate(final AjaxRequestTarget target) { AjaxUpdatingWidget.this.onUpdate(target); }
ajax.focusComponent(((AjaxUpdatingWidget) valueEditor).getFocusComponent());